akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;

template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}

#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()

/* do your best */

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

  vector<int> cnt(n, 0);

  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (b[i] >= a[j]) {
        cnt[j]++;
        break;
      }
    }
  }

  lint id;
  lint ans = -INF;
  for (int i = 0; i < n; i++) {
    if (ans < cnt[i]) {
      id = i + 1;
      ans = cnt[i];
    }
  }

  cout << id << endl;

  return 0;
}



Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
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;
}
int main(){
    string s;
    cin >> s;
    ll n = s.size();
    ll cnt = 0;
    ll ans = 0;
    for (ll i = 0; i < n;i++){
        if (s[i] == 'B') cnt++;
        else
            ans += cnt;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3752
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;

namespace atcorder1
{
    class MainClass
    {
        public static long Read()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {
            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }
        public static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            var n = Read();
            var x = new long[n];
            var y = new long[n];
            var d = new double[n*(n-1)/2];
            double d1 = 1;
            for(int i = 0; i < n; i++)
            {
                var input = Reads();
                x[i] = input[0];
                y[i] = input[1];
            }
            long c = 1;
            for(long i = 1; i <n; i++)
            {
                c *= i;
            }
            
            double sum = 0;
            int k = 0;
            for(int i = 0; i < n-1; i++)
            {
                for(int j = i+1; j < n; j++)
                {
                    d1 = Math.Pow((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]), 0.5);
                    sum += d1;
                    
                }
            }
            
            Console.WriteLine(sum*2/n) ;
            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 13396
#include<bits/stdc++.h>
using namespace std;
#define max(a,b) (a<b?b:a)
#define abs(x) (x<0?(-x):x)
#define F(i,L,R) for (int i = L; i < R; i++)
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define RF(i,L,R) for (int i = L; i > R; i--)
#define RFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a)
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define VgetI(n) int (n); scanf("%d",&(n))
#define VgetII(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define VgetIII(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define ll long long
#define INF 1000000000000000005
#define nINF -2000000000
#define MOD 1e9+7
#define PI 3.1415926535897932384626
int main(){
	int a,b,c;
	while(~getIII(a,b,c)) printf("%d\n",b/a<c?b/a:c); 
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
typedef long long ll;
using namespace std;

int main() {
	ll n,a,b;
	cin>>n;
	if(n==1){
		cout << "Hello World"<<endl;
	}
	else{
		cin>>a>>b;
		cout << a+b<<endl;
	}
	return 0;
}




Measured memory_bytes: 256
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,ssse3")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
using namespace std;
using ll = long long;
using pi = pair<ll, ll>;
using vi = vector<ll>;
using vpi = vector<pi>;
const int maxn = 1<<21, mod = 1e9 + 7;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int x, a;
	cin >> x >> a;
	cout << (x>=a)*10;
}


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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);

  ll a, b, c; std::cin >> a >> b >> c;
  std::cout << (a * chmin(c, b-1)) / b << "\n";
}


Measured memory_bytes: 3636
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        int arr[][] = new int[3][3];
        Scanner in = new Scanner(System.in);
        for(int j=0; j < 3; j++){
            for(int i=0; i <3; i++){
                arr[j][i] = in.nextInt();
            }
        }
        int num = in.nextInt();
        int hit[] = new int[num];
        for(int i=0; i<num; i++){
            hit[i] = in.nextInt();
        }

        for(int j=0; j < 3; j++){
            for(int i=0; i <3; i++){
                for(int k=0; k<num; k++){
                    if(arr[j][i] == hit[k]){
                        arr[j][i] = 0;
                    }
                }
            }
        }

        // 探索
        int check[][] = {
            {0, 1, 2},
            {3, 4, 5},
            {6, 7, 8},
            {0, 3, 6},
            {1, 4, 7},
            {2, 5, 8},
            {0, 4, 8},
            {2, 4, 6}
        
        };

        boolean flag = false;

        for(int j=0; j<check.length; j++){
            if((arr[check[j][0]/3][check[j][0]%3] + arr[check[j][1]/3][check[j][1]%3] + arr[check[j][2]/3][check[j][2]%3]) == 0){
                flag = true;
            }
        }
        if(flag){
            System.out.print("Yes");
        }else{
            System.out.print("No");

        }
        
    }
}

Measured memory_bytes: 21972
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>

using namespace std;

int main(){

  int m;
  cin >> m;
  long long s=0,l=0;

  for(int i=0;i<m;i++){
    long long int a,b;
    cin >> a >> b;
    s+=a*b;
    l+=b;
  }
  cout << (s-1)/9+l-1 << endl;
  

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef std::pair<ll, ll> P;

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

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

constexpr ll mod = 1e9 + 7;

constexpr ll mpow(ll x, ll n) {
	ll ans = 1; x %= mod;
	while (n != 0) {
		if (n & 1) ans = ans * x % mod;
		x = x * x % mod;
		n = n >> 1;
	}
	return ans;
}

ll inv_mod(ll a) { return mpow(a, mod - 2); }

class modint {
	std::uint_fast64_t Modulus = 1e9 + 7;
	using u64 = std::uint_fast64_t;

public:
	u64 a;
	constexpr modint(const u64 x = 0) noexcept : a(x% Modulus) {}
	constexpr u64& value() noexcept { return a; }
	constexpr const u64& value() const noexcept { return a; }
	constexpr modint operator+(const modint rhs) const noexcept {
		return modint(*this) += rhs;
	}
	constexpr modint operator-(const modint rhs) const noexcept {
		return modint(*this) -= rhs;
	}
	constexpr modint operator*(const modint rhs) const noexcept {
		return modint(*this) *= rhs;
	}

	constexpr modint operator / (const modint p) const noexcept {
		modint tmp(mpow(p.a, Modulus - 2));
		return modint(*this) *= tmp;
	}

	constexpr modint& operator+=(const modint rhs) noexcept {
		a += rhs.a;
		if (a >= Modulus) {
			a -= Modulus;
		}
		return *this;
	}
	constexpr modint& operator-=(const modint rhs) noexcept {
		if (a < rhs.a) {
			a += Modulus;
		}
		a -= rhs.a;
		return *this;
	}
	constexpr modint& operator*=(const modint rhs) noexcept {
		a = a * rhs.a % Modulus;
		return *this;
	}
	constexpr modint& operator /= (const modint& p) noexcept {
		modint tmp(mpow(p.a, mod - 2));
		*this = modint(*this) * tmp;
		return *this;
	}
	constexpr operator u64() const { return a; }
};

int main() {
	ll n;
	cin >> n;
	string s;
	cin >> s;
	map<char, int> m;
	m['R'] = 0;
	m['G'] = 1;
	m['B'] = 2;
	vector<int> codes(n);
	rep(i, n) codes[i] = m[s[i]];
	vector<vector<ll>> ss(3, vector<ll>(n + 1, 0));
	rep(j, n) {
		rep(i, 3) {
			ss[i][j + 1] = ss[i][j];
		}
		ss[codes[j]][j + 1]++;
	}
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {			
			if (codes[i] == codes[j]) continue;
			int c = codes[i] | codes[j];
			int id = -1;
			if (c == 1) id = 2;
			if (c == 2) id = 1;
			if (c == 3) id = 0;
			ll count = ss[id][n] - ss[id][j + 1];
			if (j + j - i < n) {
				if (codes[j + j - i] == id) {
					count--;
				}
			}
			ans += max(0LL, count);
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3544
#include "bits/stdc++.h"
using namespace std;
string st;
int getnum( int l) {
	int num = 0;
	while (isdigit(st[l])) {
		num = num * 10 + st[l] - '0';
		l++;
	}
	return num;
}
int calc(const int a,const int b,const char type) {
	if (type == '+')return a + b;
	else if (type == '-')return a - b;
	else if (type == '*')return a*b;
	else {
		if (b)return a / b;
		else {
			throw(false);
		}
	}
}
set<int> getexpr(const int l,const int r) {
	set <int>aset;
	int depth = 0;
	bool flag = false;
	for (int x = l; x <= r; ++x) {
		if (st[x] == '(') {
			depth++;
		}
		else if (st[x] == ')') {
			depth--;
		}
		else if (st[x] == '+' || st[x] == '-' || st[x] == '*' || st[x] == '/') {
			if (!depth) {
				flag = true;
				const set<int> lset = getexpr(l, x - 1);
				const set<int> rset = getexpr(x + 1, r);
				for (auto a : lset) {
					for (auto b : rset) {
						if (st[x] == '/'&&!b)continue;
						else {
							aset.emplace(calc(a, b, st[x]));
						}
					}
				}
			}
		}
	}
	if (!flag) {
		if (st[l] == '(')return getexpr(l + 1, r - 1);
		aset.emplace(getnum(l));
	}
	return aset;
}
int main() {
	while (1) {
		cin >> st;
		if (st == "#")break;
		set<int>aset=getexpr(0,st.size()-1);	
		cout << aset.size() << endl;
	}
	return 0;
}

Measured memory_bytes: 3080
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>
#include <time.h>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }

int N, d[112345];

int main() {

	scanf("%d", &N);
	rep(i, N) scanf("%d", &d[i]);

	sort(d, d + N);

	printf("%d\n", d[N / 2] - d[N / 2 - 1]);

	return 0;
}


Measured memory_bytes: 640
#!/usr/bin/env python3


class UnionFind():
    def __init__(self, size):
        self.table = [-1 for _ in range(size)]
        self.num = [1 for _ in range(size)]

    def size(self, x):
        return self.num[self.find(x)]

    def find(self, x):
        while self.table[x] >= 0:
            x = self.table[x]
        return x

    def union(self, x, y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 != s2:
            if self.table[s1] != self.table[s2]:
                if self.table[s1] < self.table[s2]:
                    self.table[s2] = s1
                else:
                    self.table[s1] = s2
            else:
                self.table[s1] += -1
                self.table[s2] = s1
            self.num[s1] += self.num[s2]
            self.num[s2] = self.num[s1]
        return


N, M = map(int, input().split())
uf = UnionFind(N)
L = [list(map(int, input().split())) for _ in range(M)]
ans = [N * (N - 1) // 2] * M
for i in range(1, M)[::-1]:
    A, B = map(lambda x: int(x) - 1, L[i])
    ans[i - 1] = ans[i]
    if uf.find(A) != uf.find(B):
        ans[i - 1] -= uf.size(A) * uf.size(B)
    uf.union(A, B)

print(*ans, sep='\n')


Measured memory_bytes: 38864
#include<bits/stdc++.h>
using namespace std;
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define uii             unordered_map<int,int>
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
void S_K_S()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

int32_t main()
{
	S_K_S();
	int n,c;
	cin>>n>>c;
	int w[n],v[n];
	for(int i=0;i<n;i++){
		cin>>w[i]>>v[i];
	}
	int dp[n+1][c+1];
	memset(dp,0,sizeof(dp));
	for(int i=1;i<=n;i++){
		for(int j=1;j<=c;j++){
			if(w[i-1]<=j)
				dp[i][j]=max(v[i-1]+dp[i-1][j-w[i-1]],dp[i-1][j]);
			else
			    dp[i][j]=dp[i-1][j];
		}
	}
	cout<<dp[n][c];
}


Measured memory_bytes: 82488
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//　ceil(a/b)   (a + (b - 1))/ b
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const ll mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

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

int cans(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}





int main(){
  int n,x,y;
  cin >> n >> x >> y;
  x--;y--;
  vector<int> ans(n);
  
  rep(sn,n){
    vector<int> dist(n,inf);
    queue<int> q;
    auto f = [&](int i, int d){
	       if(dist[i] != inf) return;
	       dist[i] = d;
	       q.push(i);
	     };
    f(sn,0);
    while(!q.empty()){
      int now = q.front();q.pop();
      int distnow = dist[now];
      if(now-1>=0) f(now-1,distnow+1);
      if(now+1<n) f(now+1,distnow+1);
      if(now == x) f(y,distnow+1);
      if(now == y) f(x,distnow+1);
    }
    rep(i,n){
      ans[dist[i]]++;
    }
  }
  rep(i,n) ans[i]/=2;
  for(int i = 1; i<n; i++) cout << ans[i] << endl;
  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int k;
    cin >> k;
    long long int sums = 0;
    for(int i=1; i<=k; i++){
        for(int j=1; j<=k; j++){
            for(int l=1; l<=k; l++){
                sums += __gcd(i, __gcd(j, l));
            }
        }
    }
    cout << sums;
    return 0;
}

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

int main()
{
  int v[3][3];
  bool a[3][3];
  int N,t,count,ans;
  count=0;
  ans=0;
  for(int i=0;i<3;i++)
  {
    for(int j=0;j<3;j++)
    {
      cin >> v[i][j];
      a[i][j]=false;
    }
  }
  cin >> N;
  for(int i=0;i<N;i++)
  {
    cin >> t ;
    for(int x=0;x<3;x++)
    {
      for(int y=0;y<3;y++)
      {
        if(t==v[x][y])
        {
          a[x][y]=true;
          count++;
        }
      }
    }
    
  }
  
 
   if((a[0][0]==true)&&(a[1][1]==true)&&(a[2][2]==true))
   {
       cout <<"Yes"<<endl;
   }
  else if((a[0][2]==true)&&(a[1][1]==true)&&(a[2][0]==true))
   {
          cout <<"Yes"<<endl;
   }
   else{
     for(int i=0;i<3;i++)
    {
      if((a[i][0]==true)&&(a[i][1]==true)&&(a[i][2]==true))
      {
        cout <<"Yes"<<endl;
        ans=1;
        break;
      }
      if((a[0][i]==true)&&(a[1][i]==true)&&(a[2][i]==true))
      {
        cout <<"Yes"<<endl;
        ans=1;
        break;
        
      }
       
    }
     if(ans==0)
     {
       cout <<"No"<<endl;
     }
   }
    
   
   
 
  

  
}


Measured memory_bytes: 256
import bisect

n = int(input())
*a, = sorted(map(int, input().split()))
*b, = sorted(map(int, input().split()))
*c, = sorted(map(int, input().split()))

ans = 0
for _b in b:
    aNum = bisect.bisect_left(a, _b)
    cNum = len(c) - bisect.bisect_right(c, _b)
    ans += aNum*cNum

print(ans)


Measured memory_bytes: 23092
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

int main(void){
    int r;
    cin >> r;

    if (r % 10 == 2 or r % 10 == 4 or r % 10 == 5 or r % 10 == 7 or r % 10 == 9)cout << "hon";
    if (r % 10 == 0 or r % 10 == 1 or r % 10 == 6 or r % 10 == 8)cout << "pon";
    if (r % 10 == 3)cout << "bon";
    
    
    
    
}

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

int main(){
  int n,m,e,j,ave2,ave3;

  while(1){
    cin>>n;
    if(n==0)
      break;
    for(int i=0;i<n;i++){
      cin>>m>>e>>j;
      ave2=m+e;
      ave3=m+e+j;
      if((m==100 || e==100|| j==100) || (ave2 >= 180) || (ave3 >= 240))
        cout<<"A"<<endl;
      else if((ave3 >= 210) || ((ave3>=150) && (m >= 80 || e >= 80)))
        cout<<"B"<<endl;
      else
        cout<<"C"<<endl;
    }
  }
  return 0;
}



Measured memory_bytes: 3060
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cstdio>
#include<cmath>
#include<deque>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#include<tuple>
#include<utility>
#include<vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef vector<vector<int>> vvi;

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define REP(i, n)  for(int i=0; i<(int)(n); i++)
#define REPS(i, n)  for(int i=1; i<=(int)(n); i++)
#define PER(i, n) for(int i=(int)(n)-1; i>= 0; i--)
#define PERS(i, n)  for(int i=(int)(n); i>0; i--)
#define FOR(i, c) for(__typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define RFOR(i, c)  for(__typeof((c).rbegin()) i=(c).rbegin(); i!=(c).end(); i++)
#define ALL(container)  (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) (container).size()
#define FILL0(n)  setfill('0') << right << setw(n)
#define mp(a, b)  make_pair(a, b)
#define toLower(c)  c+0x20
#define toUpper(c)  c-0x20
#define pb  push_back
#define eb  emplace_back

const int INF = 1e9;
const long long LLINF = 1e18;
const int MOD = 1000000007;

int main(){
  int N, M; cin >> N >> M;
  priority_queue<ll> A;
  REP(i, N){
    ll n; cin >> n;
    A.push(n);
  }
  PERS(i, M){
    int n = A.top();
    A.pop();
    n /= 2;
    A.push(n);
  }
  ll ans = 0;
  REP(i, N){
    ans += A.top();
    A.pop();
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1400
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::str::*;
#[allow(unused_imports)]
use std::mem::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::HashMap;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();
    line.trim().to_string().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_cols<T: FromStr>() -> Vec<T> {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();

    line.trim()
        .split_whitespace()
        .map(|s| s.parse().ok().unwrap())
        .collect()
}

fn dfs(
    n: usize,
    mat: &Vec<Vec<(usize, i32)>>,
    positions: &mut Vec<Option<i32>>,
    visited: &mut Vec<bool>,
) -> bool {
    if visited[n] {
        return true;
    }

    visited[n] = true;
    for &(m, diff) in mat[n].iter() {
        let pos_m = positions[n].unwrap() + diff;
        if let Some(current_pos_m) = positions[m] {
            if current_pos_m != pos_m {
                return false;
            }

            continue;
        }

        positions[m] = Some(pos_m);
        if !dfs(m, mat, positions, visited) {
            return false;
        }
    }

    return true;
}

fn execute() -> bool {
    let header = read_cols::<usize>();
    let n_variables = header[0];
    let n_info = header[1];

    let mut mat = Vec::new();
    mat.resize(n_variables, Vec::<(usize, i32)>::new());

    for _ in 0..n_info {
        let info = read_cols::<i32>();
        let i_left = (info[0] - 1) as usize;
        let i_right = (info[1] - 1) as usize;
        let diff = info[2];
        mat[i_left].push((i_right, diff));
        mat[i_right].push((i_left, -diff));
    }
    let mat = mat;

    let mut visited = Vec::new();
    visited.resize(n_variables, false);

    let mut positions = Vec::<Option<i32>>::new();
    positions.resize(n_variables, None);

    for i in 0..n_variables {
        if visited[i] {
            continue;
        }

        positions[i] = Some(0);

        if !dfs(i, &mat, &mut positions, &mut visited) {
            return false;
        }
    }

    return true;
}

fn main() {
    println!(
        "{}",
        match execute() {
            false => "No",
            true => "Yes",
        }
    );
}


Measured memory_bytes: 22396
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
struct dice {
	P x[3];
	dice(int x_[6]) {
		x[0] = P(x_[0], x_[5]);
		x[1] = P(x_[1], x_[4]);
		x[2] = P(x_[2], x_[3]);
	}
	int X(int n) {
		return n < 3 ? x[n].first : x[5 - n].second;
	}
	void N() {
		swap(x[0], x[1]);
		swap(x[1].first, x[1].second);
	}
	void E() {
		swap(x[0], x[2]);
		swap(x[0].first, x[0].second);
	}
	void W() {
		swap(x[0], x[2]);
		swap(x[2].first, x[2].second);
	}
	void S() {
		swap(x[0], x[1]);
		swap(x[0].first, x[0].second);
	}
	void C() {
		swap(x[1], x[2]);
		swap(x[2].first, x[2].second);
	}
	void RC() {
		swap(x[1], x[2]);
		swap(x[1].first, x[1].second);
	}
	void top(int val) {
		if (x[0].first == val) {
			return;
		}
		if (x[1].first == val) {
			N();
		}
		else if (x[2].first == val) {
			W();
		}
		else if (x[2].second == val) {
			E();
		}
		else if (x[1].second == val) {
			S();
		}
		else {
			N(); N();
		}
	}
	void front(int val) {
		if (x[1].first == val) {
			return;
		}
		if (x[2].first == val) {
			C();
		}
		else if (x[2].second == val) {
			RC();
		}
		else {
			swap(x[1].first, x[1].second);
			swap(x[2].first, x[2].second);
		}
	}
};

int main()
{
	int x[6], q, t, f;
	for (int i = 0; i < 6; i++) {
		cin >> x[i];
	}
	dice d(x);
	cin >> q;
	while (q--) {
		cin >> t >> f;
		d.top(t);
		d.front(f);
		cout << d.x[2].first << endl;
	}
	return 0;
}

Measured memory_bytes: 3048
#include<stdio.h>

int main(){
    int h, m, s;
    scanf("%d", &s);
    h = s / 3600;
    s = s % 3600;
    m = s / 60;
    s = s % 60;
    printf("%d:%d:%d\n", h, m, s);
    return 0;
}


Measured memory_bytes: 2084
#include <stdio.h>

void sort(int *a, int n) {
    int i, j, tmp;

    for(i=0; i<n-1; i++){
        for(j=i+1; j<n; j++) {
            if(a[i] > a[j]){
                tmp = a[i];
                a[i] = a[j];
                a[j] = tmp;
            }
        }
    }
}

int main(void){
    int i, j, n, q, head1, head2, prev, cnt;

    int s[10000];
    int t[500];

    scanf("%d", &n);

    for(i=0; i<n; i++) {
        scanf("%d", &s[i]);
    }

    scanf("%d", &q);

    for(i=0; i<q; i++) {
        scanf("%d", &t[i]);
    }

    sort(s, n);
    sort(t, q);

    head1 = 0;
    head2 = 0;
    prev = -1;
    cnt = 0;

    for(i=head1; i<q; i++) {
        for(j=head2; j<n; j++){
            if(t[i] == s[j] && t[i] != prev) {
                cnt++;
                head1 = i+1;
                head2 = j+1;
                prev = t[i];
            }
        }
    }

    printf("%d\n", cnt);

    return 0;


}


Measured memory_bytes: 2088
import java.util.Scanner;
public class Main{
    public static void main(String[] aa){
        Scanner s = new Scanner(System.in);
        String st;
         
        int i,now=0,m;
        while(true){
        st = s.next();
        if(st.charAt(0)=='-')break;
        m =s.nextInt();
           for(i=0;i<m;i++){
            now+=s.nextInt();
           }
           for(i=0;i<st.length();i++){
               System.out.print(st.charAt((now+i)%st.length()));
           }
           System.out.println();
           now=0;
       }
    }   
}


Measured memory_bytes: 26308
#include<stdio.h>
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
long long n,k,i,j,x,y,m,s;
cin>>n>>k;
for(i=0;i<k;i++){
	cin>>x>>y;
	if(x>n/2)x=n-x+1;
	if(y>n/2)y=n-y+1;
	m=min(x,y);
	s=m%3;
	if(s==0)s=3;
	cout<<s<<endl;
}
return 0;
}
	
	

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

int main()
{
    int n;
    cin >> n;
    int sum = 0;
    int lmax = 0;
    for (int i = 0; i < n; i++) {
        int l;
        cin >> l;
        sum += l;
        lmax = max(lmax, l);
    }
    sum -= lmax;
    if (lmax < sum) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

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

int N;
vector<int> ds;

int main() {
  cin >> N;
  int d;
  for(int i=0; i<N; i++) {
    cin >> d;
    ds.push_back(d);
  }
  sort(ds.begin(), ds.end());
  cout << ds[N/2] - ds[N/2-1] << endl;
  return 0;
}



Measured memory_bytes: 892
import sys
sys.setrecursionlimit(100000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from copy import *

N = int(input())
A = list(map(int, input().split()))
for i in range(N-1):
    A[i+1] += A[i]
C = Counter(A)
ans = C[0]
for x in C:
    ans += (C[x]-1)*C[x]//2
print(ans)


Measured memory_bytes: 37120
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>

using ll = long long;
typedef std::pair<int, int>p;

ll min(ll a, ll b) {
	if (a >= b)return b;
	else return a;
}
ll max(ll a, ll b) {
	if (a >= b)return a;
	else return b;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);

}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

const ll Z = 1000000007;
const ll INF = 1 << 30;
const ll INF2 = 9000000000000000000LL;
bool flag = true;
bool fl = true;
struct edge { int to, cost; };
std::vector<edge>v[100];
bool used[210];

int main() {
	ll n, a[100000], b[100000], ans = 0;
	std::cin >> n;
	for (int i = 1;i <= n;i++) {
		std::cin >> a[i] >> b[i];
	}
	ll sum = 0;
	for (int i = n ;i > 0;i--) {
		a[i] += sum;
		if (a[i] % b[i] == 0) continue;
		else {
			if (a[i] <= b[i]) {
				ans += b[i] - a[i];
				sum += b[i] - a[i];
			}
			else {
				ans += (a[i] / b[i] + 1)*b[i] - a[i];
				sum += (a[i] / b[i] + 1)*b[i] - a[i];
			}
		}
	}
	std::cout << ans << std::endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll n;
  cin >> n;
  cout << n * 800 - n / 15 * 200 << endl;
}

Measured memory_bytes: 3648
#include <iostream>
using namespace std;
int main(){
  int n; cin >> n;
  int p=0;
  
  for(int i=1;i<=n;i+=2){
    int o=0; 
    for(int j=1;j<=i;j++)
        if(i%j==0) o++;
    if(o==8)p++;
  }
  
  cout << p << endl;

  return 0;
}

Measured memory_bytes: 3648
#include<set>
#include<map>
#include<stack>
#include<cmath>
#include<queue>
#include<deque>
#include<cstdio>
#include<ctime>
#include<bitset>
#include<vector>
#include<climits>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
#define LL long long
#define ULL unsigned long long
int read(){
	int f=1,x=0;char c=getchar();
	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}
	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();
	return f*x;
}
#define MAXN 100000
#define INF 0x3f3f3f3f
#define Mod int(1e9+7)
char S[MAXN+5];
int p=13,Pow[MAXN+5],pos[MAXN+5],f[MAXN+5][13];
int main(){
	Pow[0]=1;
	for(int i=1;i<=MAXN;i++)
		Pow[i]=Pow[i-1]*10%p;
	scanf("%s",S+1);
	int len=strlen(S+1),Les=0,n=0;
	for(int i=1;i<=len;i++){
		if('0'<=S[i]&&S[i]<='9')
			Les=(Les+(S[i]-'0')*Pow[len-i])%p;
		else
			pos[++n]=len-i;
	}
	f[0][0]=1;
	for(int i=0;i<n;i++)
		for(int j=0;j<p;j++)
			for(int k=0;k<=9;k++){
				int mo=k*Pow[pos[i+1]]%p;
				f[i+1][(j+mo)%p]=(f[i+1][(j+mo)%p]+f[i][j])%Mod;
			}
	printf("%d\n",f[n][((5-Les)%p+p)%p]);
	return 0;
}


Measured memory_bytes: 6144
n =  gets.to_i
array = gets.split.map(&:to_i)
cnt = 0
for i in 0..n-1
	indexMin = i
	for k in i..n-1
		if array[k] < array[indexMin]
			indexMin = k
		end
	end
	array[i],array[indexMin] = array[indexMin],array[i]
	if i != indexMin
	    cnt += 1
	end
end

puts  array.join(" ")
puts cnt

Measured memory_bytes: 8692
#include <iostream>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <list>
#include <math.h>
#include <map>
using namespace std;
#define REP(i, k, n) for(int i = k;i < n; i++)
#define rep(i, n) REP(i,0,n)
#define ll long long int
int dx[4] = {0,-1,1,0};
int dy[4] = {-1,0,0,1};
#define eps 10e-6
#define mod 1000000007
int main(void){
	int N;
	ll a[100001];
	cin >> N;
	rep(i,N){
		cin >> a[i];
	}
	sort(a,a+N);
	int maxi = a[N-1];
	int med = maxi/2;
	int mini = 1000000001;
	int index = -1;
	rep(i,N){
		if(maxi == a[i])continue;
		if(abs(med-a[i]) <= mini){
			mini = abs(med-a[i]);
			index = i;
		}
	}
	cout << maxi << " " << a[index] << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<limits.h>
#include<string>
#include<iomanip>
#include<numeric>
#include<queue>
using namespace std;

long long  mod = 1000000007;

long max(long x, long y) {
	return x > y ? x : y;
}

long min(long x, long y) {
	return x < y ? x : y;
}

long factorial(long n) {
	if (n == 1) {
		return 1;
	}
	else {
		return n * factorial(n - 1);
	}
}

long long  fel(long long  n,long long  f) {

		if (f == 1) {
			return n % mod;
		}
		else if (f % 2 == 0) {
			return (fel(n,f / 2) * fel(n,f / 2)) % mod;
		}
		else {
			return ((n  * fel(n,f / 2) %mod) * fel(n,f / 2))% mod;
		}
	

}


int main()
{
	int sum=0;
	int n;
	string s;
	cin >> n;
	cin >> s;

	for (int i = 0; i <= 9; i++) {
			int l1 = 0;
			while (l1 < n) {
				if (s[l1] - '0' == i) {
					l1++;
					break;
				}
				else {
					l1++;
				}
			}
		for (int j = 0; j <= 9; j++) {
			int l2= l1;
			while (l2 < n) {
				if (s[l2] - '0' == j) {
					l2++;
					break;
				}
				else {
					l2++;
				}
			}
			for (int k = 0; k <= 9; k++) {
				int l3 = l2;
				while (l3 < n) {
					if (s[l3] - '0' == k) {
						sum++;
						break;
					}
					else {
						l3++;
					}
				
					}
					}

			}
		}
	cout << sum;

}




Measured memory_bytes: 256
// From youtube - atcoder abc142 f
// https://www.youtube.com/watch?v=l4pTJy13sbM

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

#define rep(i, n) for(int i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

ll powmod(ll x, ll n) { // like pow(x, n)
  ll r = 1;
  while (n) {
    if (n & 1) {
      r = r * x % MOD;
    }
    x = x * x % MOD;
    n >>= 1;
  }
  return r;
}

vector< vector<int> > graph;
vector<int> state;
vector<int> vs;

bool dfs(int v) {
  if (state[v] == 1) { // intermediate
    vs.erase(vs.begin(), find(all(vs), v)); // remove all elements before v.
    return true;
  }
  if (state[v] == -1) { // Already visited
    return false;
  }
  // state[v] == 0
  vs.push_back(v);
  state[v] = 1;
  for (int u : graph[v]) {
    if (dfs(u)) { return true; }
  }
  state[v] = -1;
  vs.pop_back();
  return false;
}

int N, M;

void solve() {
  vector<int> nxt(N), visited(N), erased(N, 1);
  rep(i, vs.size()) {
    int v = vs[i];
    int u = vs[(i+1)%vs.size()];
    nxt[v] = u;
    erased[v] = 0;
  }
  int v = vs[0];
  while (!visited[v]) {
    for (int u : graph[v]) {
      if (erased[u]) { continue; }
      int nv = nxt[v];
      while (nv != u) {
        erased[nv] = 1;
        nv = nxt[nv];
      }
      nxt[v] = u;
    }
    visited[v] = 1;
    v = nxt[v];
  }

  vector<int> ans;
  int sv = v;
  while (true) {
    ans.push_back(v);
    v = nxt[v];
    if (v == sv) { break; }
  }
  cout << ans.size() << endl;
  for (auto v : ans) {
    cout << v + 1 << endl;
  }
}

int main(int argc, char** argv) {
  cin >> N >> M;
  graph.resize(N);
  rep(i, M) {
    int A, B;
    cin >> A >> B;
    --A; --B; // 0-indexed
    graph[A].push_back(B);
  }

  state.resize(N);
  rep(i, N) {
    if (!state[i]) {
      if (dfs(i)) {
        // for (int v : vs) { cout << v << endl; }
        solve();
        return 0;
      }
    }
  }

  cout << -1 << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main(){
    int n;
    cin >> n;
    ll a[n];
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    ll ans[n];
    ll l=-3,r=2*a[0];
    while(true){
        ll mid=(r+l+1)/2;
        if(mid%2==1)mid++;
        ans[0]=mid;
        for(int j=1; j<n; j++){
            ans[j]=a[j-1]-ans[j-1]/2;
            ans[j]*=2;
        }
        if((ans[0]+ans[n-1])==2*a[n-1])break;
        else if((ans[0]+ans[n-1])<2*a[n-1])l=mid;
        else r=mid;
    }
    for(int i=0; i<n; i++){
        cout << ans[i] << " ";
    }
    cout << endl;
}

Measured memory_bytes: 2816
while True:
    HW = list(map(int, input().split()))
    H, W = HW[0], HW[1]
    if H == 0 and W == 0:
        break

    tiles = [input() for i in range(H)]
    i, j, count = 0, 0, 0
    while True:
        tile = tiles[i][j]
        if count >= H*W:
            print("LOOP")
            break

        if tile == ">":
            if W > j:
                j += 1
            else:
                print(j, i)
                break

        elif tile == "<":
            if j > 0:
                j -= 1
            else:
                print(j, i)
                break

        elif tile == "^":
            if i > 0:
                i -= 1
            else:
                print(j, i)
                break

        elif tile == "v":
            if H > i:
                i += 1
            else:
                print(j, i)
                break
        else:
            print(j, i)
            break
        count += 1

Measured memory_bytes: 7644
#include <cstdio>
#include <algorithm>
#include <string>

int main() {
  char buf[1024];
  scanf("%s", buf);
  std::string s = buf;
  s += std::string(15, 'o');
  printf("%s\n", (std::count(s.begin(), s.begin()+15, 'o') >= 8)? "YES":"NO");
}


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

int main() {
  
  int N, height, tmpCenti = 0;
  cin >> N;
  vector<int> centi(N);
  for( int i = 0; i < N; i++){
    cin >> centi.at(i);
  }

  sort( centi.begin(), centi.end() );
  for(int i = 0; i < N; i++){
    if(tmpCenti < centi.at(i)){
      tmpCenti = centi.at(i);
      height++;
    }
  }
  
  cout << height << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <map>
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define pb(a) push_back(a)
#define MAX(a, b) ((a < b)?b:a)
#define MIN(a, b) ((a > b)?b:a)
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;

template<typename T> void cinpb(vector<T>& x) { T n; cin >> n; x.push_back(n); }
ull gcd(ull a, ull b) { return b ? gcd(b, a%b) : a; }
ull lcm(ull m, ull n) {	return ((0 == m) || (0 == n)) ? 0 : ((m / gcd(m, n)) * n); }
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };


//
int func(int a, int b, int c)
{
	return a * 10 + b + c;
}

int main()
{
	int a, b, c;

	cin >> a >> b >> c;

	int s = func(a, b, c);
	s = MAX(func(a, c, b), s);
	s = MAX(func(b, a, c), s);
	s = MAX(func(b, c, a), s);
	s = MAX(func(c, a, b), s);
	s = MAX(func(c, b, a), s);

	cout << s << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define ll2(x, y) ll x, y; cin >> x >> y;
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)

struct tsk{
  int s, t, e;
  void nxt(void){
    scanf("%d%d%d", &s, &t, &e);
    --s; --t;
    return;
  }
};
tsk ste[50000];
int b[10000];
int c[10000];
void pf(int n){
  printf("%d", c[0]);
  for(int j = 1;j < n;++j)printf(" %d", c[j]);
  kara;
  return;
}

signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    int2(n, m);
    rep(i, 50010){
      ste[i].nxt();
      if(ste[i].s == -1 && ste[i].t == -1 && ste[i].e == 0)break;
    }
    int(l);
    for(;l--;){
      scn(m, b);
      rep(j, n)c[j] = 0;
      rep(i, 50010){
        if(ste[i].s == -1 && ste[i].t == -1 && ste[i].e == 0)break;
        c[ste[i].s] += ste[i].e * b[ste[i].t];
      }
      pf(n);
    }


/*/

//*/ break;
  }
  return 0;
}

Measured memory_bytes: 3808
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define repi(i,name) for(auto itr i=name.begin();i!=name.end();i++)
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
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 long long INFLL = 1LL<<62;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int a,b,c;
	int ans=0;
	cin >>a>>b>>c;
	ans=min(b/a ,c);
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> ls(n);
  for(Int i=0;i<n;i++) cin>>ls[i];
  sort(ls.begin(),ls.end());

  Int ans=0;
  for(Int i=0;i<n;i++)
    for(Int j=i+1;j<n;j++)
      ans+=ls.begin()+i-upper_bound(ls.begin(),ls.begin()+i,ls[j]-ls[i]);

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


Measured memory_bytes: 256
D, G = map(int, input().split())

P = []
C = []

for i in range(D):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c)

ans = 1000
for i in range(2**D):
    point = 0
    num = 0
    unsolved = []
    for j in range(D):
        if (i >> j)&1 == 1:
            point += 100*(j + 1)*P[j] + C[j]
            num += P[j]
        
        else:
            unsolved.append(j)

    if G <= point:
        ans = min(num, ans)
    
    
    else:
        l = []
        unsolved.reverse()
        for i in unsolved:
            l += [100*(i + 1)]*(P[i] - 1)
        for j in range(len(l)):
            point += l[j]
            num += 1

            if G <= point:
                ans = min(num, ans)
print(ans)

Measured memory_bytes: 9260
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
const ll inf = (1LL << 55LL);
struct node{
    ll a, b, c;
    node(){}
    node(ll _a, ll _b, ll _c){
        a = _a;
        b = _b;
        c = _c;
    }
    bool operator < (const node &tmp) const{
        return a - b < tmp.a - tmp.b;
    }
};
int W, B, R, n;
vector<node> v;
ll dp_W[maxn], dp_B[maxn];
void take_W(){
    priority_queue<ll> q;
    ll sum = 0;
    for(int i = 0; i < n; i ++){
        dp_W[i] = -inf;
    }
    for(int i = n - 1; i >= 0; i --){
        q.push(-v[i].a);
        sum += v[i].a;
        if(W < (int)q.size()){
            ll tmp = -q.top();
            q.pop();
            sum -= tmp;
        }
        if(W == (int)q.size()){
            dp_W[i] = sum;
        }
    }
}
void take_B(){
    priority_queue<ll> q;
    ll sum = 0;
    for(int i = 0; i < n; i ++){
        dp_B[i] = -inf;
    }
    for(int i = 0; i < n; i ++){
        q.push(-v[i].b);
        sum += v[i].b;
        if(B < (int)q.size()){
            ll tmp = -q.top();
            q.pop();
            sum -= tmp;
        }
        if(B == (int)q.size()){
            dp_B[i] = sum;
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin >> W >> B >> R;
     n = W + B + R;
    ll a, b, c;
    ll ret = 0;
    for(int i = 0; i < n; i ++){
        cin >> a >> b >> c;
        v.push_back(node(a - c, b - c, c));
        ret += c;
    }
    sort(v.begin(), v.end());
    take_W();
    take_B();
    ll mxx = -inf;
    for(int i = 0; i + 1 < n; i ++){
        mxx= max(mxx, dp_B[i] + dp_W[i + 1]);
    }
    cout << ret + mxx << endl;
    return 0;
}


Measured memory_bytes: 6384
#include<stdio.h>
#include<string.h>
int main()
{
	int i;
	char s[111111],a[111111]={};

	scanf("%s",s);

	for(i=0;i<strlen(s);i++)
		a[s[i]-'a']=1;
	for(i=0;i<26;i++)
		if(a[i]==0){
			printf("%c",'a'+i);
			return 0;
		}
	printf("None");
	return 0;
}

Measured memory_bytes: 384