akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
typedef long long ll;
const ll INF = 2147483647;
const ll MOD = 1e9 + 7;
const double EPS = 1e-10;
const double pi = acos(-1);//3.1415926535897932384626433832795028...
const ll SIZE = 2000005;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
ll fac[SIZE], finv[SIZE], inv[SIZE];
vector<ll>dij;
struct edge { ll to, cost; };
vector<vector<edge> >G;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

ll mod_pow(ll a, ll b) {
	ll res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}
	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T & t, const V & v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T & t, const V & v) {
	for (auto& e : t) fill_v(e, v);
}

template<typename T>
void outp(vector<T>v) {
	for (int i = 0; i < v.size(); ++i) {
		cout << v[i];
		if (i != v.size() - 1) { cout << " "; }
	}
}

double add(double a, double b) {
	if (abs(a + b) < EPS * (abs(a) + abs(b))) { return 0; }
	return a + b;
}

double len(int a, int b, int c, int d) {
	return (double)sqrt((a - c) * (a - c) + (b - d) * (b - d));
}

ll n, ans;
int main() {
	cin >> n;
	vector<ll>v(n);

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

	for (int i = 0; i < 60; ++i) {
		ll ze = 0, on = 0;
		for (int j = 0; j < n; ++j) {
			((v[j] >> i) & 1) ? ++ze : ++on;
		}
		ll res = (ze * on) % MOD;
		for (int j = 0; j < i; ++j) { res *= 2; res %= MOD; }

		ans += res;
		ans %= MOD;
	}

	cout << ans % MOD << endl;
}

Measured memory_bytes: 2560
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <queue>
# define MOD 1000000000+7
# define INF 1000000000
#define rep(i,rept)	for(ll i = 0; i<rept;i++)
typedef long long ll;
using namespace std;
long long int a = 0, b = 0, c = 0,d=0,e=0, ans = 0, x = 0, y = 0, z = 0, n = 0, m = 0, maxy = 0, mini = 9999, counter = 0, endp = 0, checker = 0;

std::vector <long long int> vec{}, vecsec{}, vecth{};
long long int iremono[100001], koware[100001];
long long int iremono2[100001], check[100001],xpo[10000001],ypo[10000001],hei[1000001];
std::vector<std::string>kinds{}, kaku{};
char maze[1000][1000];
int sx, sy;
int gx, gy;
pair<long long int, long long int>pairs[101],pointkaku[10000000];
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
bool okada = false, okada2 = false;
std::string output, output2, input, input2;
char re;
int starta, startb, enda, endb,ab;


unsigned long long int LCM(unsigned long long int a, unsigned long long int b) {
	unsigned long long int i, j;
	i = a; j = b;
	while (true) {

		c = i % j;
		i = j;
		if (c != 0) {

			j = c;

		}
		else {
			break;
		}
	}
	return j * (a / j) * (b / j);
}
int kaizyo(int k) {
	int sum = 1;
	for (int i = 1; i <= k; ++i)
	{
		sum *= i;
	}
	return sum;
}

int H, W;//はんい
bool qw = false, er = false, ty = false,ui=false;
int main() {
	cin >> a>>b;
	iremono[0] = 0;
	rep(i, a) {
		cin >> x;
		iremono[i+1] = iremono[i] + x;
}
	for (int i = 0; i <= a; i++) {
		if (iremono[i] <= b) {
			ans++;
		}
}
	cout << ans << endl;
}


Measured memory_bytes: 2304
// テ・ツ淞コテヲツ慊ャテ」ツδ?」ツδウテ」ツδ療」ツδャテ」ツδシテ」ツδ?

#include <iostream>
#include <iomanip>
#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 <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

typedef pair<int, int> pii;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

signed main() {
    int p, q; cin >> p >> q;
    int g = __gcd(p, q);
    q /= g;
    int ans = 1;
    for(int i=2; i*i<=q; i++) {
        if(q % i == 0) {
            ans *= i;
            while(q % i == 0) q /= i;
        }
    }
    ans *= q;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3104
fn main() {
    let (a, b, c, d) = read();
    let ans = solve(a, b, c, d);
    write(ans);
}

fn read() -> (i32, i32, i32, i32) {
    let mut l1 = String::new();
    std::io::stdin().read_line(&mut l1).ok();
    let mut iter = l1.trim().split_whitespace();
    let a: i32 = iter.next().unwrap().parse().unwrap();
    let b: i32 = iter.next().unwrap().parse().unwrap();
    let c: i32 = iter.next().unwrap().parse().unwrap();
    let d: i32 = iter.next().unwrap().parse().unwrap();

    (a, b, c, d)
}

fn write(s: &str) {
    println!("{}", s);
}

fn solve<'a>(mut a: i32, b: i32, mut c: i32, d: i32) -> &'a str {
    loop {
        c -= b;
        if c < 1 {
            break "Yes"
        }

        a -= d;
        if a < 1 {
            break "No"
        }
    }
}

Measured memory_bytes: 2084
<?php

while($line = fgets(STDIN)){
	$s = floatval($line);
	$total = 0;
	for($i = 1; $i <= 10; $i ++){
		
		if($i % 2 == 0){
			// ??¶??°??????
			$s = $s * 2;
		}elseif($i != 1){
			// ?\???°??????
			$s = $s / 3;
		}
		
		$total += $s;
	}
	echo $total."\n";
}

Measured memory_bytes: 15076
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); 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 FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x << ": " << x << "\n"
#define PRINTALL(V)    \
  for (auto v : (V)) { \
    cerr << v << " ";  \
  }                    \
  cerr << "\n";
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
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;
}
template <class T> using vec = std::vector<T>;
template <class T> void print(const T &x) { cout << x << "\n"; }
const int MOD = 1000000007, INF = 1061109567;
const double EPS = 1e-10, PI = acos(-1.0);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int Q;
  cin >> Q;

  const int MAXQ = 100010;

  vec<bool> p(MAXQ + 1, true);
  p[0] = p[1] = false;
  for (int i = 2; i <= MAXQ; ++i) {
    if (p[i]) {
      for (int j = i * 1LL * i; j <= MAXQ; j += i) {
        p[j] = false;
      }
    }
  }
  // DEBUG(count(p.begin(), p.begin() + 101, true));

  vec<bool> flg(MAXQ + 1, false);
  vec<int> flgSum(MAXQ + 1);
  flgSum[0] = 0;
  REPS(i, MAXQ) {
    if (i % 2 == 1) {
      flg[i] = p[i] && p[(i + 1) / 2];
    }
  }
  REPS(i, MAXQ) { flgSum[i] = flgSum[i - 1] + flg[i]; }
  //  DEBUG(flg[3]);
  // DEBUG(flgSum[2017]);
  //  DEBUG(count(flg.begin() + 3, flg.begin() + 8, true));
  REP(i, Q) {
    int l, r;
    cin >> l >> r;
    print(flgSum[r] - flgSum[l - 1]);
  }
}

Measured memory_bytes: 1408
import java.util.*;

import static java.lang.System.*;

// -2進数表現
// 2進数の変換方法を参考
// https://sci-pursuit.com/math/binary-number-conversion.html
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();


        List<Integer> tmp = new ArrayList();

        if(N == 0){
            tmp.add(0);
        } else {
            int base = -2;
            while (N != 1) {
                int mod = N % base;
                switch (mod) {
                    case -1:
                        tmp.add(1);
                        N = N / base + 1;
                        break;
                    default:
                        tmp.add(mod);
                        N = N / base;
                }
            }
            tmp.add(N);
            Collections.reverse(tmp);
        }

        String ans = "";
        for(int i = 0; i < tmp.size(); i++){
            ans += Integer.toString(tmp.get(i));
        }
        out.println(ans);
    }
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;
  map<string, int> mp;
  mp["AC"] = 0;
  mp["WA"] = 0;
  mp["TLE"] = 0;
  mp["RE"] = 0;
  rep(i, 0, n) {
    string s;
    cin >> s;
    mp[s]++;
  }

  cout << "AC x " << mp["AC"] << endl;
  cout << "WA x " << mp["WA"] << endl;
  cout << "TLE x " << mp["TLE"] << endl;
  cout << "RE x " << mp["RE"] << endl;
}


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

    #define ll long long
    #define ff first
    #define ss second
    #define pb push_back
    #define vll vector<ll>
    #define mll map<ll,ll>
    #define MOD 1000000007
    #define pll pair<ll,ll>
constexpr ll INF = 1999999999999999997; 
    #define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
    int main() {
        fastio;
        string s;
        cin>>s;
        string t;
        cin>>t;
        int c=0;
        int l=s.length();
        for(int i=0;i<l;i++)
        {
            if(s[i]!=t[i])
                c++;
        }
        cout<<c<<endl;
    }

Measured memory_bytes: 3752
#include <iostream>
typedef long long ll;
using namespace std;

int main(void) {
    ll N,M;cin>>N>>M;
    if (N > 2 && M > 2) cout << (N - 2) * (M - 2) << endl;
    else if (M == 2 || N == 2) cout << 0 << endl;
    else if (M == 1 && N > 2) cout << N - 2 << endl;
    else if (M > 2 && N == 1) cout << M - 2 << endl;
    else if (M == 1 && N == 1) cout << 1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>

using namespace std;

typedef long long ll;

vector<int> g[100 * 1000 + 218];
int ans[100 * 1000 + 218];
int to[100 * 1000 + 218];

int GetMaxPath(int v) {
  if (g[v].empty()) return 0;
  if (ans[v] != -1) return ans[v];
  ans[v] = 0;
  for (int t = 0; t < g[v].size(); ++t) {
    if (ans[v] < 1 + GetMaxPath(g[v][t])) {
      ans[v] = 1 + GetMaxPath(g[v][t]);
      to[v] = g[v][t];
    }
  }
  return ans[v];
}


int main()
{
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n - 1 + m; ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[b].push_back(a);
  }

  memset(ans, -1, sizeof(ans));
  for (int i = 0; i < n; ++i) GetMaxPath(i);

  for (int i = 0; i < n; ++i) {
    if (g[i].empty()) {
      cout << 0 << endl;
      continue;
    }
    cout << to[i] + 1 << endl;
  }

  return 0;
}


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

using namespace std;

void solve()
{
     int n;
     cin>>n;

     string s;
     cin>>s;

     vector<int>r,g;
     map<int,bool>mp;

     for(int i=0;i<n;i++)
     {
         if(s[i]=='R')
            r.push_back(i+1);
         if(s[i]=='G')
            g.push_back(i+1);

         if(s[i]=='B')
            mp[i+1]=true;
     }

     long long res=r.size()*g.size()*mp.size();

     for(auto i:r)
     {
         for(auto k:g)
         {
             if((i+k)%2==0 && mp[(i+k)/2])// j is AM
                res--;
             if(mp[2*i-k])
                res--;

             if(mp[2*k-i])
                res--;
         }
     }
     cout<<res<<endl;
}

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

    solve();

    return 0;
}


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

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

const int lim = 1000000007;

int main(){
    string S;
    cin >> S;
    int N = (int)S.size();

    //xを除いたSの文字の並びかた
    string t;
    rep(i, N){
        if(S[i] == 'x') continue;
        t.push_back(S[i]);
    }

    //xを除いたSの逆順の文字の並び方
    string t_rev;
    reverse(S.begin(), S.end());
    rep(i, N){
        if(S[i] == 'x') continue;
        t_rev.push_back(S[i]);
    }

    //tとt_revが一致しないならば、回文にはできない
    if(t != t_rev){
        cout << -1 << endl;
        return 0;
    }

    //x以外の文字の個数の半分を求める
    int val = ((int)t.size() + 2 - 1) / 2;
    vector<int> cnt_a;
    vector<int> cnt_b;
    int cnt = 0;
    rep(i, N){
        if(S[i] == 'x') cnt++;
        else{
            cnt_a.push_back(cnt);
            cnt = 0;
        }
        if((int)cnt_a.size() == val) break;
    }
    reverse(S.begin(), S.end());
    cnt = 0;
    rep(i, N){
        if(S[i] == 'x') cnt++;
        else{
            cnt_b.push_back(cnt);
            cnt = 0;
        }
        if((int)cnt_b.size() == val) break;
    }
    int ans = 0;
    rep(i, (int)cnt_a.size()){
        ans += fabs(cnt_a[i] - cnt_b[i]);
    }
    cout << ans << endl;
    return 0;
}

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

#define MOD 1'000'000'007

template<class T>
T modpow(T a, T p)
{
  if (p == 0) return 1;
  if (p % 2 == 0) {
    T h = modpow(a, p / 2);
    return h * h % MOD;
  } else {
    return a * modpow(a, p - 1) % MOD;
  }
}

template<class T>
T combination(T a, T b)
{
  if (a - b < b) return combination(a, a - b);
  T ansmul = 1;
  T ansdiv = 1;
  for (T i = 0; i < b; i++) {
    ansmul *= a - i;
    ansdiv *= i + 1;
    ansmul %= MOD;
    ansdiv %= MOD;
  }
  T ans = ansmul * modpow(ansdiv, T(MOD) - 2) % MOD;
  return ans;
}

int main()
{
  uint64_t n, m;
  cin >> n >> m;
  uint64_t ans = 1;
  for (uint64_t i = 2; i * i <= m; i++) {
    if (m % i == 0) {
      uint64_t count = 0;
      while (m % i == 0) {
        count++;
        m /= i;
      }
      ans *= combination(n + count - 1, count);
      ans %= MOD;
    }
  }
  if (m != 1) {
    ans *= n;
    ans %= MOD;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
using namespace std;
int main(void){
    long long n,c,k;
    cin>>n>>c>>k;
    vector<long long> t(n);
    for(int i=0;i<n;i++){
        cin>>t[i];
    }
    long long ans=0;
    sort(t.begin(),t.end());
    for(int i=0;i<n;){
        long long l=i,r=min(i+c-1,n-1),mid;
        for(int j=0;j<50;j++){
            mid=(l+r)/2;
            if(mid==l||mid==r){
                if(t[r]>t[i]+k)r=l;
            }
            if(t[mid]<=t[i]+k)l=mid;
            else r=mid;
        }
        //cout<<i<<" "<<r<<endl;
        ans++;
        i=r+1;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

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

        System.out.println(C % getGCD(A,B) == 0 ? "YES" : "NO");
    }
    static private int getGCD(int a , int b){
        while( a % b != 0 ){
            if (a > b) {
                a = a - b;
            }else {
                b = b - a;
            }
        }
        return Math.min(a, b);
    }
}


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

typedef long long ll;
ll T, n, a, b, g, ans;
ll ab(ll p) {return p >0 ? p : -p;}
int main()
{
//	cin >> T;
	T = 1;
	while (T--) {
		cin >> n >> a >> b;
		g = ab(a - b);
		if (g % 2 == 0) cout << g / 2 << endl;
		else {
			ans = min(max(a - 1, b - 1), max(n - a, n - b));
			ans = min(ans, a - 1 + g / 2 + 1);
			ans = min(ans, n - b + g / 2 + 1);
			cout << ans << endl;
		}
	}
    return 0;
}


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

int main(){
	int n;
	scanf("%d", &n);
	long ans = 0;
	long count = 0;
	for(int i=0; count <= n; i++) {
		if(!(i % 3) || !(i % 5)) {
			count++;
			continue;
		}
		ans += i;
		count++;
	}
	printf("%ld\n", ans);
}


Measured memory_bytes: 3824
#include <bits/stdc++.h>
#define For(i, a, b) for(register int (i) = (a); (i) <= (b); ++(i))
#define ForDown(i, a, b) for(register int (i) = (a); (i) >= (b); (i)--)
using namespace std;
template<class Tp>
Tp F() {
	register Tp x = 0, ch = getchar(), f = 0;
	while(!isdigit(ch)) f |= (ch == '-'), ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}
template<class Tp>
bool chkmin(Tp &a, Tp b) {
	return b > a ? a = b, 1 : 0;
}
template<class Tp>
bool chkmax(Tp &a, Tp b) {
	return b < a ? a = b, 1 : 0;
}
const int MAXN = 110;
string s1, s2;
int ans = 0;
int n;
int main() {
	cin >> s1, s2 = s1, n = s1.length();
	reverse(s2.begin(), s2.end());
	for(register int i = 0; i < n; ++i) {
		if(s1[i] == s2[i]) continue;
		else {
//			cout << s1[i] << " " << s2[i] << endl;
			++ans;
		}
	}
	printf("%d\n", ans / 2);
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();

		if (B % A == 0) {
			System.out.println(A + B);
		} else {
			System.out.println(Math.abs(A - B));
		}

	}
}

Measured memory_bytes: 21204
package main

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

func main() {
	sc.Split(bufio.ScanWords)
	N := nextInt()
	a1 := nextIntArray(N)
	a2 := nextIntArray(N)

	res := 0
	for i := 0; i < N; i++ {
		cur := 0
		for j := 0; j <= i; j++ {
			cur += a1[j]
		}
		for j := i; j < N; j++ {
			cur += a2[j]
		}
		res = max(res, cur)
	}
	fmt.Println(res)
}

func dfs(u int, edges [][]Edge, vis []bool, pos []int) bool {
	// fmt.Println(u, edges, vis, pos)
	vis[u] = true

	res := true
	for _, e := range edges[u] {
		if !vis[e.to] {
			pos[e.to] = pos[u] + e.d
			res = res && dfs(e.to, edges, vis, pos)
		} else {
			if pos[u] + e.d != pos[e.to] {
				res = false
			}
		}
	}
	return res
}

type Edge struct {
	to int
	d int
}

// -------- Library --------
func max(x, y int) int {
	if x < y {
		return y
	} else {
		return x
	}
}

func abs(x int) int {
	if x > 0 {
		return x
	} else {
		return -x
	}
}

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	v, err := strconv.Atoi(next())
	if err != nil {
		fmt.Println("Failed to read int", err)
		os.Exit(1)
	}
	return v
}

func nextIntArray(size int) []int {
	res := make([]int, size)
	for i := 0; i < size; i++ {
		res[i] = nextInt()
	}
	return res
}


Measured memory_bytes: 640
#include<iostream>
#include<bits/stdc++.h>
#include<iomanip>
#include<math.h>
#include<vector>
#include<cctype>
#include<string>
#include<set>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
std::string line;
typedef long long ll;

int main(){
   int h,w,n;
   cin >> h >> w >> n;

   int cnt = 0;
   int sum = 0;
   if(w>=h){
     rep(i,h+1){
        sum = i*w;
        if(sum >=n){
           cnt = i;
           break;
        }
     } 
   }else{
      rep(i,w+1){
         sum = i*h;
         if(sum >= n){
         cnt = i;
         break;
         }
      }
   }
   
   cout << cnt << endl;




   return 0;
}

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

int main(){
  int A,B;

  cin >> A >> B;
  int C = A*B;
  if(C%2 == 0){
   cout << "Even" << endl;
  }else{
   cout << "Odd" << endl;
  }
}

Measured memory_bytes: 256
n, k = map(int, input().split())
a = [0] * n
counter = 0
for i in range(k):
  d = int(input())
  a_list = map(int, input().split())
  for j in a_list:
    a[j - 1] += 1
for i in a:
  if i == 0:
    counter += 1
print(counter)


Measured memory_bytes: 9204
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
using namespace std;

int channelCount[30][200002];
int allCount[200002];

int main()
{
	memset(channelCount, 0, sizeof(channelCount));
	memset(allCount, 0, sizeof(allCount));

	int N, C;
	cin >> N >> C;
	for (auto i = 0; i < N; ++i)
	{
		int s, t, c;
		cin >> s >> t >> c;
		++channelCount[c - 1][s * 2 - 1];
		--channelCount[c - 1][t * 2];
	}

	for (auto j = 0; j < 30; ++j)
	{
		if (channelCount[j][0] > 0)
		{
			++allCount[0];
		}
		for (auto i = 1; i < 200002; ++i)
		{
			channelCount[j][i] += channelCount[j][i - 1];

			if (channelCount[j][i] > 0)
			{
				++allCount[i];
			}
		}
	}

	auto result = allCount[0];
	for (auto i = 1; i < 200002; ++i)
	{
		result = max(result, allCount[i]);
	}

	cout << result << endl;

	return 0;
}

Measured memory_bytes: 24448
using System;
using System.Linq;

public class Hello
{
    public static void Main()
    {
        
        int[] a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        int N = a[0];
        int M = a[1];
        int[] foods = new int[M + 10];
        
        for(int i = 0; i < N; i++)
        {
            int[] s = Console.ReadLine().Split(' ').Select(y => int.Parse(y)).ToArray();
            int K = s[0];
            for(int j = 1; j < s.Length; j++)
            {
                foods[s[j]]++;
            }
        }
        
        int num = 0;
        for(int i = 0; i < foods.Length; i++)
        {
            if(foods[i] == N) num++;
        }
        Console.WriteLine(num);
        
    }
}


Measured memory_bytes: 13268
#include<cstring>
#include<string>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<sstream>
#include<climits>
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

const int MAX_N = 200000;
int n, k;
int c[MAX_N+1];

int main() {
  cin >> n >> k;
  rep(i,n) {
    int a;
    cin >> a;
    ++c[a];
  }

  vector<int> vec;
  for (int i = 1; i <= n; ++i) {
    if (c[i] != 0) vec.push_back(c[i]);
  }

  sort(all(vec));

  int s = (int)vec.size();
  int ans = 0;

  for (int i = 0; i < (s-k); ++i) {
    ans += vec[i];
  }

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 2168
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
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; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


int calc(int a,int b){
  if(b == 0) return 1;
  if(b%2 == 0){
    int d = calc(a,b/2);
    return (d*d)%MOD;
  }
  return (a*calc(a,b-1))%MOD;
}

int comb(int n,int r){
  int tmp = 1,ttmp = 1;
  for(int i = n;i >= n-r+1;i--) tmp = (tmp*i)%MOD;
  for(int i = 1;i <= r;i++) ttmp = (ttmp*i)%MOD;
  return (tmp*calc(ttmp,MOD-2))%MOD;
}

int f(int n, int m, int k){
  int c = comb(n*m-2, k-2);
  int ans = 0;
  FOR(i, 1, n){
    (ans += (m*m*(n-i))%MOD*c*i%MOD) %= MOD;
  }

  return ans;
}
signed main() {
  int N, M, K;
  cin >> N >> M >> K;

  cout << (f(N, M, K)+f(M, N, K))%MOD << "\n";

  return 0;
}

Measured memory_bytes: 256
use std::io::stdin;

fn main() {
    let mut st = String::new();
    stdin().read_line(&mut st).unwrap();
    let n: i64 = st.trim().parse().unwrap();
    let mut st = String::new();
    stdin().read_line(&mut st).unwrap();
    let mut a:Vec<i64> = st.trim().split(" ").map(|x| x.parse().unwrap()).collect();
    let mut result = vec![0;(n as usize)];
    for i in a.iter() {
        result[(i-1) as usize] += 1;
    };
    for i in result.iter() {
        println!("{}", i);
    }
}


Measured memory_bytes: 5780
// https://atcoder.jp/contests/abc074/tasks/arc083_a

#include <bits/stdc++.h>
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define REPR(i, n) for (int(i) = (n); (i) >= 0; (i)--)
#define FOR(i, m, n) for (int(i) = (m); (i) < (n); i++)
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;

int A, B, C, D, E, F, ma, mb, l;
double cd, md;
set<int> x, y;

int main()
{
  cin >> A >> B >> C >> D >> E >> F;

  l = (F + B - 1) / B;
  REP(i, l)
  {
    ll xi = i * B;
    while (xi <= F)
    {
      if (0 < xi)
        x.insert(xi * 100);
      xi += A;
    }
  }
  double ms = 1.0 * F / (100 + E) * E;
  l = (ms + D - 1) / D;
  REP(i, l)
  {
    ll yi = i * D;
    while (yi <= ms)
    {
      y.insert(yi);
      yi += C;
    }
  }

  ma = A * 100;
  md = mb = 0;
  for (auto &a : x)
  {
    for (auto &b : y)
    {
      if (100 * b <= a * E && a + b <= F)
      {
        cd = 100.0 * b / (a + b);
        if (md < cd)
        {
          md = cd;
          ma = a + b;
          mb = b;
        }
      }
    }
  }

  cout << ma << " " << mb << '\n';

  return 0;
}


Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main (void)
{
  int n;
  string s;
  cin>>n>>s;
  int i,j;
  j=0;
  for(i=0;i<n-2;i++)
  {
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C'){j++;}
  }
  cout<<j<<endl;

}

Measured memory_bytes: 3600
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solveA();
		// new Main().solveB();
		// new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();

			int wk = numB;
			int res = 0;
			while (wk >= numA && res < numC) {
				wk -= numA;
				res++;
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
}

Measured memory_bytes: 21844
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<utility>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

int main(){
	string s;
	cin >> s;
	set<int> a;
	for(int i=0; i<s.size(); i++)
		a.insert(s[i]-'a');
	if(a.size()==26){
		cout << "None" << '\n';
		return 0;
	}
	for(int i=0; i<26; i++){
		if(a.find(i) == a.end()){
			cout << char(i+'a') << '\n';
			return 0;
		}
	}
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define fop(i,m,n) for (int i=(m);i<(n);++i)
#define FOP(i,m,n) for (int i=(m)-1;i>=(n);--i)
#define test(x) cout << #x << ' ' << x << endl;
#define eb emplace_back
#define pb push_back
#define mp make_pair 
#define MAXN 100100

int main () {
	int n,w;
	cin >> n >> w;
	int x[n], y[n];
	fop (i,0,n) cin >> x[i] >> y[i];
	lli dp[MAXN];
	fop (i,0,MAXN) dp[i] = (1ll << 30);
	dp[0] = 0;
	fop (i,0,n) {
		FOP (j,MAXN - y[i], 0) {
			dp[j + y[i]] = min(dp[j + y[i]], dp[j] + x[i]);
		}
	}
	FOP (i,MAXN,0) {
		if (dp[i] <= w) {
			cout << i << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 1152
#![allow(unused_imports)]

use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::{i32, i64, i128, u32, u64, u128, f64};
use std::io::{stdout, Write, BufWriter};
use std::mem::{swap};
use proconio::marker::{Isize1, Usize1, Bytes, Chars};

#[proconio::fastout]
fn main() {
    proconio::input!{
        n: usize,
        k: usize,
        mut ps: [i32; n],
    }
    ps.sort();
    println!("{}", ps[..k].iter().sum::<i32>());
}


Measured memory_bytes: 2176
// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

const int N = 1e5+5;

char s[N];

bool p(char s[], int len) {
    static char t[N];
    memcpy(t, s, len);
    t[len] = 0;
    reverse(t, t+len);
    // dbg(len);
    // printf("%s\n", t);
    // for (int i=0; i<len; ++i)
    //     putchar(s[i]);
    // putchar('\n');
    for (int i=0; i<len; ++i)
        if (t[i] != s[i])
            return false;
    return true;
}

int main(int argc, char const *argv[]) {
    // code
    scanf("%s", s);
    int n = strlen(s);
    if (p(s, n) && p(s, n/2) && p(s+n/2+1, n/2))
        puts("Yes");
    else
        puts("No");
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;


int main(){
  int N; cin >> N; int a[N];
  rep(i, N){
    cin >> a[i];
  }
  int left = 0, right = 0, bits=0; ll ans = 0;
  rep(left, N){
    while(right<N && (bits^a[right])==(bits+a[right])){
      bits^=a[right]; right++;
    }
    ans+=right-left;
    if(right==left) right++;
    else bits^=a[left];
  }
  cout << ans << endl;
}

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

#define rep(i, n) for(ll i=0; i<n; i++)
#define all(v) v.begin(), v.end()
#define vec vector

typedef long long ll;

/*  <<bit全探索>>

    for (int tmp = 0; tmp < (1 << ビット数); tmp++) {
        bitset<ビット数> s(tmp);
    }
*/

/*　<<stringで読み込んだ数列を一桁ずつint型へ変換>>

    string str;
    int N[桁数];

    cin >> str;

    for (int i = 0; i < 15; ++i) {

        N[i] = (int)(str[i] - '0');  //str[i]　はchar型なのでchar→intへ変換

        //cout << N[i] << endl;  //確認のため表示
    }
*/

int main(){

    int A, B, C, D;
    cin >> A >> B >> C >> D;

    rep(i, 1000){
        if(C <= (B * i) && A >= (D * i)){
            cout << "Yes" << endl;
          break;
        }
        else if(C > (B * i) && A <= (D * i)){
            cout << "No" << endl;
          break;
        }
          else if(C <= (B * i) && A <= (D * i)){
            cout << "Yes" << endl;
          break;
          
        }
    }
}
    

Measured memory_bytes: 3564
#coding: utf-8
from collections import Counter
N = int(input())
l = ["0", "3", "5", "7"]
ans = ["0"] * 9
cnt = 0
for a in l:
    ans[0] = a
    for b in l:
        ans[1] = b
        for c in l:
            ans[2] = c
            for d in l:
                ans[3] = d
                for e in l:
                    ans[4] = e
                    for f in l:
                        ans[5] = f
                        for g in l:
                            ans[6] = g
                            for h in l:
                                ans[7] = h
                                for i in l:
                                    ans[8] = i
                                    ans_i = int("".join(ans))
                                    ans_c = Counter(str(ans_i))
                                    if ans_i <= N and "0" not in str(ans_i) and len(ans_c.keys()) == 3 and len(str(ans_i)) >= 3:
                                        cnt += 1
print(cnt)

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
  ll r, D, X; cin >> r >> D >> X;

  for (int i = 0; i < 10; i++){
    X = r * X - D;
    cout << X << endl;
  }

  return 0;
}


Measured memory_bytes: 3488
import java.util.*;

@SuppressWarnings("unchecked")
public class Main {
	public static void printArray(int[] a) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + ", ");
		}
		System.out.println();
	}

	public static void printArrayL(long[] a) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + ", ");
		}
		System.out.println();
	}

	public static<T> void printArrayT(T[] a) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + ", ");
		}
		System.out.println();
	}

	public static String joinInt(int[] a, String separator) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				sb.append(separator);
			}
			sb.append(a[i]);
		}
		return sb.toString();		
	}

	static int[] nextIntArray(Scanner sc, int N) {
		int[] arr = new int[N];
		for (int i = 0; i < N; i++) {
			arr[i] = sc.nextInt();
		}
		return arr;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int W = sc.nextInt();
		int[] w = new int[N];
		int[] v = new int[N];
		int sumv = 0;
		for (int i = 0; i < N; i++) {
			w[i] = sc.nextInt();
			v[i] = sc.nextInt();
			sumv += v[i];
		}
		// 価値N以上で最小の重さ
		long[] dp = new long[sumv + 1];
		Arrays.fill(dp, Long.MAX_VALUE);
		dp[0] = 0;

		// 重さ3で価値30が初期データなら
		// 1〜30まで重さ3で達成可能。それ以上は無理
		// 次に重さ4で価値50が来たら、
		// 1〜30までは重さ3に勝てないので、そのまま
		// 31〜50までは重さ4で上書き、51〜80までは、その合計でいける

		sumv = 0;
		for (int i = 0; i < N; i++) {
			int wi = w[i];
			int vi = v[i];
			for (int j = sumv + vi; j > sumv; j--) {
				if (j - vi < 0) break;
				dp[j] = dp[j - vi] + wi;
			}
			for (int j = sumv; j > vi; j--) {
				dp[j] = Math.min(dp[j], dp[j - vi] + wi);
			}
			for (int j = vi; j > 0; j--) {
				dp[j] = Math.min(dp[j], wi);
			}
			sumv += vi;
		}
		int ans = 0;
		for (int i = dp.length - 1; i >= 0; i--) {
			if (dp[i] <= W) {
				ans = i;
				break;
			}
		}
		// printArrayL(dp);
		System.out.println(ans);
	}
}


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

using namespace std;

#define X first
#define Y second
#define eps  1e-5
#define gcd __gcd
#define pb push_back
#define PI acos(-1.0)
#define lowbit(x) (x)&(-x)
#define bug printf("!!!!!\n");
#define mem(x,y) memset(x,y,sizeof(x))

typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef unsigned long long uLL;

const int maxn = 1e5+7;
const int INF  = 1<<30;
const int mod  = 1e9+7;

set<int>se;

void solve(){
    long long a,b;
    cin>>a>>b;
    int ans = 1;
    for(int i=2;i<=sqrt(a);i++){
        if(a%i == 0){
            se.insert(i);
            while(a%i==0)a/=i;
        }
    }
    if(a > 1) se.insert(a);
    for(int i=2;i<=sqrt(b);i++){
        if(b%i == 0){
            if(se.count(i)) ++ans;
            while(b%i == 0) b/=i;
        }
    }
    if(b > 1 && se.count(b)) ++ans;
    printf("%d\n",ans ); 
    
    return;
}

int main()
{
#ifndef ONLINE_JUDGE
   // freopen("in.txt","r",stdin);
#endif
//    freopen("out.txt","w",stdout);
//    ios::sync_with_stdio(false);
    int t = 1;
    //scanf("%d",&t);
    while(t--){
    //    printf("Case %d: ",cas++);
        solve();
    }
#ifndef ONLINE_JUDGE
   // printf("%.10f\n",1.0*clock()/CLOCKS_PER_SEC);
#endif
    return 0;
}

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

template <typename T, typename U> void cmin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U> void cmax(T &a, U b) {
  if (a < b) a = b;
}

class UnionFind {
private:
  int N;
  vector<int> PS;

public:
  UnionFind() : N(0) {}
  UnionFind(int n) : N(n), PS(n, -1) {}
  int unite(int a, int b) {
    int x = root(a), y = root(b);
    if (x == y) return x;
    if (-PS.at(x) < -PS.at(y)) swap(x, y);
    PS.at(x) += PS.at(y);
    PS.at(y) = x;
    return x;
  }
  bool same(int a, int b) { return root(a) == root(b); }
  int root(int a) {
    if (PS.at(a) < 0) return a;
    return PS.at(a) = root(PS.at(a));
  }
  int size(int a) { return -PS.at(root(a)); }
  vector<vector<int>> groups() {
    vector<int> B(N), S(N);
    for (int i = 0; i < N; i++) {
      B.at(i) = root(i);
      S.at(B.at(i))++;
    }
    vector<vector<int>> ret(N);
    for (int i = 0; i < N; i++) {
      ret.at(i).reserve(S.at(i));
    }
    for (int i = 0; i < N; i++) {
      ret.at(B.at(i)).push_back(i);
    }
    auto f = [&](const vector<int> &v) { return v.empty(); };
    ret.erase(remove_if(ret.begin(), ret.end(), f), ret.end());
    return ret;
  }
};


signed main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  int N, M;
  cin >> N >> M;
  UnionFind UF(N);
  for (int i = 0; i < M; i++) {
    int A, B;
    cin >> A >> B, A--, B--;
    UF.unite(A, B);
  }

  set<int> SE;
  for (int i = 0; i < N; i++) {
    SE.insert(UF.root(i));
  }
  cout << SE.size() - 1 << "\n";
}

Measured memory_bytes: 7688
import java.util.*;
import java.util.Map.*;
public class Main {
    static int MAX = 50;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        long[][] c = comb(n);
        List<Long> v = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            v.add(sc.nextLong());
        }
        Collections.sort(v, Comparator.reverseOrder());

        long sum = 0;
        for (int i = 0; i < a; i++) {
            sum += v.get(i);
        }
        double ave = (double) sum / a;

        int aInCnt = 0;
        int aCnt = 0;
        for (int i = 0; i < n; i++) {
            if (v.get(i).equals(v.get(a - 1))) {
                aCnt++;
                if (i < a) {
                    aInCnt++;
                }
            }
        }

        long ans = 0;
        if (v.get(0).equals(v.get(a - 1))) {
            for (int i = a; i <= b; i++) {
                ans += c[aCnt][i];
            }
        } else {
            ans += c[aCnt][aInCnt];
        }
        System.out.println(String.format("%.6f", ave));
        System.out.println(ans);
    }

    public static long[][] comb(long n) {
        long[][] c = new long[MAX + 1][MAX + 1];
        for (int i = 1; i <= n; i++) {
            for (int j = 0; j <= n; j++) {
                if (j == 0 || i == j) {
                    c[i][j] = 1L;
                    continue;
                }
                c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
            }
        }
        return c;
    }
}


Measured memory_bytes: 22996
function Main(input) {
  var input = input.split("\n");
  var K = parseInt(input[0].split(" ")[0]);
  var T = parseInt(input[0].split(" ")[1]);
  var a = input[1].split(" ").map((el)=>{
    return parseInt(el);
  });
  var max = a.reduce( function (previous, current) {
  	return previous > current ? previous:current;
  });
  if(max-1-(K-max) > 0){
    console.log(max-1-(K-max));
  }else{
    console.log(0);
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 14328
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (((ll)1<<31)-1)
#define eps LDBL_EPSILON
#define moder (1000000007)
#define pie 3.141592653589793238462643383279
#define P std::pair<int,int>
#define prique priority_queue
#define ggr getchar();getchar();return 0;
using namespace std;
int n;
long double a,b,c,d,e,f;
signed main(){
	cin>>n;
	rep(i,n){
		cin>>a>>b>>c>>d>>e>>f;
		if(hypot(a-d,b-e)>c+f)cout<<0<<endl;
		else if(hypot(a-d,b-e)<c-f)cout<<2<<endl;
		else if(hypot(a-d,b-e)<f-c)cout<<-2<<endl;
		else cout<<1<<endl;
	}
	return 0;
}


Measured memory_bytes: 3208
#include <bits/stdc++.h>
using namespace std;
#define dhoom ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);  
typedef long long ll;
typedef long double ld;
const ll inf = 1e18;
const int nax = 2e6 + 7;
const ll mod = 1e9 + 7;
//ll tree[4 * nax];
//9uS-22RSwk7gQqh

int main(){
	dhoom;
	int n , y;
	cin >> n >> y;
	y /= 1000;
	for(int i = 0 ; i <= y/10 ; i++){
		for(int j = 0 ; j <= y/5 ; j++){
			int k = y - 10*i - 5*j;
			if(k < 0)
				continue;
			if(i + j + k == n){
				cout << i << " " << j << " " << k << endl;
				return 0;
			}
		}
	}
	cout << "-1 -1 -1" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdint>

int main()
{
    int64_t N;
    std::cin >> N;
    std::vector<int64_t> bit(64);

    for (int i=0; i<N; ++i) {
        int64_t A;
        std::cin >> A;
        for (int b=0; b<64; ++b) {
            int64_t mask = 1LL << b;
            if (A & mask) {
                bit[b] += 1;
            }
        }
    }
    int64_t const DIV = 1000000007LL;
    //                  2147483647LL; max 32bit
    //         9223372036854775807LL; max 64bit
    int64_t sum = 0LL;
    for (int b=0; b<64; b+=1) {
        int64_t x = bit[b] * (N - bit[b]);
        //int64_t v = 1LL << b;
        //v %= DIV;
        for (int bb=0; bb<b; ++bb)
            x = (x * 2) % DIV;
        //int64_t y = x * v;
        //y %= DIV;
        sum += x;
        sum %= DIV;
    }
    std::cout << sum << std::endl;
    return 0;
}

Measured memory_bytes: 256
S=list(input())
if S==['S','S','R']:
    print('1')
elif S==['S','R','S']:
    print('1')
elif S==['R','S','S']:
    print('1')
elif S==['R','R','S']:
    print('2')
elif S==['R','S','R']:
    print('1')
elif S==['S','R','R']:
    print('2')
elif S==['R','R','R']:
    print('3')
else:
    print('0')

Measured memory_bytes: 9132
#include<bits/stdc++.h>
using namespace std;
#define INF 99999
int main()
{
    int n;
    cin>>n;
    int nn=n;
    int a[26]={0};
    for(int mm=0;mm<26;mm++)
        a[mm]=0;
    char s[100005];
    while(n--)
    {
        cin>>s;
        int i,hashi[26];
    for(int mm=0;mm<26;mm++)
        hashi[mm]=0;
        for(i=0;s[i];i++)
        {
              hashi[s[i]-'a']++;
        }
       //  for(int ii=0;ii<26;ii++)
      //  cout<<ii<<" "<<a[ii]<<endl;
        for(i=0;i<26;i++)
        {
            if(nn==n+1)
            {
                a[i]=hashi[i];
            }
            else
                {
                 a[i]=min(a[i],hashi[i]);
                }
        }
       //  for(int ii=0;ii<26;ii++)
       // cout<<ii<<" "<<a[ii]<<endl;
        nn=-43535;
    }
    int i;
   // for(i=0;i<26;i++)
    //    cout<<i<<" "<<a[i]<<endl;
    int j;
    for(i=0;i<26;i++)
    {
        if(a[i]==0)
            continue;
        j=a[i];
        int k;
        for(k=0;k<j;k++)
            printf("%c",'a'+i);
    }
}


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

public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();

        if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0) {
            _out.println(0);
        } else {
            _out.println(Math.min(a * b, Math.min(b * c, c * a)));
        }
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
}

Measured memory_bytes: 21972