akhauriyash/Code-Regression huggingface dataset:
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>

#define                           int                         long long
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);




using namespace std;

const int inf=1e18;
const int mod=1e9+7;
const int M=4000009;
inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}

bitset<M>dp;

 main()

{
    fast
    int n;
    int sum=0;
    cin>>n;
    int a[n+4];
    f(i,1,n)
    {
        cin>>a[i];
        sum+=a[i];
    }
    sort(a+1,a+n+1);
    dp.set(0);
    for(int i=1;i<=n;i++)
    {
        dp|=(dp<<a[i]);
    }
    int mid=(sum/2);
    for(int i=mid;i>=0;i--)
    {
        if(dp[i])
        {
            cout<<sum-i<<endl;
            return 0;
        }
    }

}













Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll  ans,l,r,k,n;
const ll mod=1e9+7;
int main()
{
	cin>>n>>k;
	for(ll i=k;i<=n+1;i++)
	{
		l=(0+i-1)*i/2;
		r=(n+n-i+1)*i/2;
		ans=(ans+r-l+1)%mod;//qweasdz
	}
	cout<<ans;
    return 0;
}


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

using namespace std;

long long a, b, c;

int main() {
    cin >> a >> b >> c;
    cout << min(abs(a-a/2-a/2)*b*c, min(abs(b-b/2-b/2)*a*c, abs(c-c/2-c/2)*a*b));
}


Measured memory_bytes: 256
dice_length, sums = gets.chomp.split(" ").map(&:to_i)
dices = gets.chomp.split(" ").map(&:to_f)
expect_sums = [0]
ans = 0
dices.map do |dice|
  expect = (dice + 1) / 2
  expect_sums.push(expect_sums[-1] + expect)
  if expect_sums.length > sums then
      tmp_ans = expect_sums[-1] - expect_sums[-1 - sums]
      ans = tmp_ans > ans ? tmp_ans : ans
  end
end
puts ans

Measured memory_bytes: 19132
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<set>
#include<algorithm>
#include<utility>
#include<map>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1001001001;

ll pow_mod(ll p, ll n, ll m) {
	if (n == 0) return 1;
	else if (n == 1) return p % m;
	else if (n % 2 == 1) return p * pow_mod(p, n - 1, m) % m;
	else {
		ll tmp = pow_mod(p, n / 2, m);
		return (tmp * tmp) % m;
	}
}

ll gcd(ll x, ll y) {
	if (y == 0) {
		return x;
	}
	return gcd(y, x % y);
}

ll com_mod(ll n, ll k, ll m) {
	if (k == 0) return 1;
	else {
		ll x = 1;
		ll y = 1;
		for (ll i = 0; i < k; i++) {
			x = (x * (n - i)) % m;
			y = (y * (i + 1)) % m;
		}
		ll res = (x * pow_mod(y, m - 2, m)) % m;
		return res;
	}
}

int main() {
	string a, b; cin >> a >> b;
	reverse(a.begin(), a.end());
	if (a == b)cout << "YES" << endl;
	else cout << "NO" << endl;
 	return 0;
}

Measured memory_bytes: 3588
N,K,Q = map(int, input().split())
A = [int(input()) for i in range(Q)]
p = [0] * N
for i in A:
    p[i - 1] += 1

ans = [x + K - Q for x in p]

for i in ans:
    if i > 0:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 12564
H, W = list(map(int, input().split()))
mp = [[]] * H
for i in range(H):
    mp[i] = input()

ans = ['#' * W for i in range(H)]

for i in range(H):
    for j in range(W):
        if mp[i][j] == '#':
            continue
        
        cnt = 0
        for dy in range(-1, 2):
            for dx in range(-1, 2):
                if dx == 0 and dy == 0:
                    continue
                nx = j + dx
                ny = i + dy
                if nx < 0 or ny < 0 or nx >= W or ny >= H:
                    continue
                if mp[ny][nx] == '#':
                    cnt = cnt + 1
            
            ans[i] = ans[i][:j] + str(cnt) + ans[i][j+1:]
            
for i in range(H):
    print (str(ans[i]))



Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using u32 = uint32_t;
using vi = vector<int>;    using vvi = vector<vi>;
using vb = vector<bool>;   using vvb = vector<vb>;
using vl = vector<ll>;     using vvl = vector<vl>;
using vd = vector<double>; using vvd = vector<vd>;

#define MAXC(c, x) (c = max(c, x))
#define MINC(c, x) (c = min(c, x))

#define REP(i,n) for(auto i = 0 * (n), i##_len = (n); i < i##_len; ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i,s,n) for(ll i=s, i##_len=(ll)(n); i<i##_len; ++i)
#define TEN(x) ((ll)1e##x)
const ll mod = TEN(9) + 7;
template<int64_t mod> struct GF {
	typedef int64_t T;
	T v;
	GF() = default;
	GF(T v) : v((v % mod + mod) % mod) {}
	GF & operator+=(GF x) { v = (v + x.v) % mod; return *this; }
	GF & operator*=(GF x) { v = (v * x.v) % mod; return *this; }
	GF & operator-=(GF x) { v = (v - x.v + mod) % mod; return *this; }
	GF & operator/=(GF x) { return (*this) *= x.inverse(); }
	GF operator+(GF rhs) const { GF lhs = *this; return lhs += rhs; }
	GF operator*(GF rhs) const { GF lhs = *this; return lhs *= rhs; }
	GF operator-(GF rhs) const { GF lhs = *this; return lhs -= rhs; }
	GF operator/(GF rhs) const { GF lhs = *this; return lhs /= rhs; }
	GF inverse() const { // http://topcoder.g.hatena.ne.jp/iwiwi/20130105/1357363348
		T a = v, b = mod, x = 1, y = 0;
		while (b) {
			T t = a / b;
			swap(a -= t * b, b);
			swap(x -= t * y, y);
		}
		return x;
	}
	GF pow(T n) const {
		GF r; r.v = 1;
		for (T x = v; n > 0; n >>= 1) {
			if (n & 1) (r.v *= x) %= mod;
			(x *= x) %= mod;
		}
		return r;
	}
	typedef size_t U;
	static GF fact(U n) {
		static vector<GF> data;
		U m = data.size();
		if (m <= n) {
			data.resize(n + 1);
			if (m == 0) { data[0].v = 1; m++; }
			for (U i = m; i < n + 1; ++i) data[i] = data[i - 1] * i;
		}
		return data[n];
	}
	static GF nCr(U n, U r) { return fact(n) / fact(r) / fact(n - r); }
	static GF nPr(U n, U r) { return fact(n) / fact(r); }
};

struct PrimeFactor { uint64_t p, e; }; // p^e
vector<PrimeFactor> prime_factors(uint64_t n) {
	vector<PrimeFactor> p;
	for (uint64_t i = 2, c; i * i <= n; i++) {
		if (n % i == 0) {
			c = 0;
			while (n % i == 0) c++, n /= i;
			p.push_back({ i, c });
		}
	}
	if (n > 1) p.push_back({ n, 1 });
	return p;
}

int main() {
#ifdef INPUT_FROM_FILE
	ifstream cin("sample.in");
	ofstream cout("sample.out");
#endif
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(50);
	ll n; cin >> n;
	vl x(n + 1, 0); x[1] = 0;
	FOR(i, 2, n + 1) {
		auto f = prime_factors(i);
		REP(j, f.size()) x[f[j].p] += f[j].e;
	}
	GF<mod> cnt = 1;
	REP(i, n + 1) {
		cnt *= x[i] + 1;
	}
	
	cout << cnt.v << endl;
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (1LL<<60)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
typedef unsigned long long int ull;
typedef long long lint;
 
int main(void){
  string S;
  cin >> S;
  int L=S.length();
  cout << S[0] << L-2 << S[L-1];
}

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

int main() {
  int a,b,c;
  cin >> a >> b >> c;
  if(a==b && a!=c)
    cout << "Yes" << endl;
  else if(a==c && a!=b)
    cout << "Yes" << endl;
  else if(b==c && a!=b)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
const ll MOD = 1e9 + 7;
class Combination{
    private:
        ll N;
        ll MOD;
        ll *fact;

    public:
        /*
         * MOD must be a prime number.
         */
        Combination(ll N, ll MOD){
            this->N = N;
            this->MOD = MOD;
            fact = new ll[N + 1];
            fact[0] = 1;
            for(ll i = 1; i <= N; i++){
                fact[i] = fact[i - 1] * i % MOD;
            }
        }

        ll pow(ll a, ll b){
            return b ? (b & 1 ? a : 1) * pow(a * a % MOD, b / 2) % MOD : 1;
        }

        ll comb(ll n, ll k){
            return fact[n] * pow(fact[n - k] * fact[k] % MOD, MOD - 2) % MOD;
        }
};

int main(){
    Combination C(1e5 + 10, MOD);
    ll N;
    cin >> N;
    vector<ll> A(N + 1);
    for(ll &a : A) cin >> a;
    vector<ll> idx(N + 1, -1);
    ll f, s;
    for(ll i = 0; i <= N; i++){
        ll a = A[i];
        if(idx[a] == -1){
            idx[a] = i;
        }else{
            f = idx[a];
            s = i;
            break;
        }
    }
    ll cnt = f + (N - s);
    for(ll K = 1; K <= N + 1; K++){
        if(cnt < K - 1){
            cout << C.comb(N + 1, K) << endl;
            continue;
        }
        //cout << C.comb(N + 1, K) << ", " << C.comb(cnt, K - 1) << endl;
        ll ans = C.comb(N + 1, K);
        ans -= C.comb(cnt, K - 1);
        ans += MOD;
        ans %= MOD;
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3584
#include<stdio.h>
void swap(int v[], int i, int j){
	int temp;
	temp = v[i];
	v[i] = v[j];
	v[j] = temp;
}
void qsort(int v[], int left, int right){
	int i, last;
	void swap(int v[], int i, int j);
	if(left >= right)
		return;
	swap(v, left, (left + right)/2);
	last = left;
	for(i = left+1; i <= right; i++)
		if(v[i] < v[left])
			swap(v, ++last, i);
		swap(v, left, last);
		qsort(v, left, last-1);
		qsort(v, last+1, right);
}
int main(){
	int N, K;
	scanf("%d %d", &N, &K);
	int p[1010];
	for(int i = 1; i <= N; i++)
		scanf("%d", &p[i]);
	qsort(p, 1, N);
	int ans = 0;
	for(int i = 0; i <= K; i++)
		ans += p[i];
	printf("%d", ans);
	return 0;
}

Measured memory_bytes: 1728
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;

    int x3, y3, x4, y4;

    int diff_x = x2 - x1;
    int diff_y = y2 - y1;

    x3 = x2 - diff_y;
    y3 = y2 + diff_x;
    x4 = x1 - diff_y;
    y4 = y1 + diff_x;

    printf("%d %d %d %d\n", x3, y3, x4, y4);
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
while(true){
int A=scan.nextInt();
int B=scan.nextInt();
if(A==0&&B==0)
break;
for(int a=0;a<A;a++){
for(int b=0;b<B;b++){
System.out.print("#");
}
System.out.println();
}
System.out.println();
}
}
}

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

struct UnionFind {
	vector<int> d;
	UnionFind(int n=0): d(n,-1) {}
	int find(int x) {
		if (d[x] < 0) return x;
		return d[x] = find(d[x]);
	}
	bool unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y) return false;
		if (d[x] > d[y]) swap(x,y);
		d[x] += d[y];
		d[y] = x;
		return true;
	}
	bool same(int x, int y) {
		return find(x) == find(y);
	}
	int size(int x) {
		return -d[find(x)];
	}
};

int deg[100005];
vector<int> to[100005];

int main() {
	int n, m, k;
	cin >> n >> m >> k;
	UnionFind uf(n);
	rep(i,m) {
		int a, b;
		cin >> a >> b;
		--a; --b;
		deg[a]++;
		deg[b]++;
		uf.unite(a,b);
	}
	rep(i,k) {
		int a, b;
		cin >> a >> b;
		--a; --b;
		to[a].push_back(b);
		to[b].push_back(a);
	}
	rep(i,n) {
		int ans = uf.size(i)-1-deg[i];
		for (int u : to[i]) {
			if (uf.same(i,u)) --ans;
		}
		cout << ans << " ";
	}
	return 0;
}


Measured memory_bytes: 6784
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int dp[3009][3009];
int main() {
    string s1,s2;
    memset(dp, 0, sizeof(dp));
    cin>>s1>>s2;
    for(int i=1;i<=s1.size();i++){
        for(int j=1;j<=s2.size();j++){
            if(s1[i-1]==s2[j-1]){
                dp[i][j]=1+dp[i-1][j-1];
            }
            else
                dp[i][j]=max(dp[i-1][j], dp[i][j-1]);
            // cout<<dp[i][j]<<" ";
        }
        // cout<<endl;
    }
    int i=s1.size(),j=s2.size();
    stack <char> s;
    while(i>0 && j>0){
        if(s1[i-1]==s2[j-1]){
            s.push(s1[i-1]);
            i--;
            j--;
        }
        else if(dp[i-1][j]>=dp[i][j-1])
            i--;
        else
            j--;
    }
    while(!s.empty()){
        cout<<s.top();
        s.pop();
    }
    cout<<endl;
    return 0;
}


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

#define ll long long
#define ld long double
#define eb emplace_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define int long long

using namespace std;
const int INF = 2e17;
const int MB = 20;
const int MOD = 1e9 + 7;

void solve() {
	int n;
	cin >> n;
	int ans = 0, last = 0;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		if (x < last) {
			ans += last - x;
		}
		else {
			last = x;
		}
	}
	cout << ans;
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cout << fixed;
	cout.precision(12);
	//srand(time(0));
	int t = 1;
	//int t;
	//cin >> t;
	while (t--) solve();
}

Measured memory_bytes: 3616
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <climits>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
struct Edge {
    int to, cost;
    Edge(int to, int cost): to(to), cost(cost) {}
};

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<Edge>> AdjList;
AdjList graph;

const int INF = 100000000;

LL N, M;
LL arr[100010]={0};
int D[110];
int L[110];
int main() {
    //cout << fixed << setprecision(15);

    int N, X; cin >> N >> X;
    REP(i, N) cin >> L[i];

    for(int i=1; i<=N; ++i){
        D[i] = D[i-1] + L[i-1];
    }

    int ans =0;
    for(int i=0; i<=N; ++i){
        if(D[i]<=X) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
int main(){
  ll n,ans=0;cin>>n;
  vector<ll> a(n),b(n),c(n);
  rep(i,n) cin>>a[i];
  rep(i,n) cin>>b[i];
  rep(i,n) cin>>c[i];
  sort(ALL(a));sort(ALL(b));sort(ALL(c));
  rep(i,n){
    ans+=(lower_bound(ALL(a),b[i])-a.begin())*(c.end()-upper_bound(ALL(c),b[i]));
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 2560
import scala.io.StdIn
import scala.collection.mutable.Buffer
import scala.annotation.tailrec

object Main extends App {
  val mod = 1000000007L
  val Array(n, m) = StdIn.readLine.split(" ").map(_.toLong)

  def factorial(num:Long):Long = {
    @tailrec
    def rec(acc:Long, num:Long):Long = {
      if(num == 1L) acc
      else rec(acc * num % mod, num-1L)
    }
    rec(1L,num)
  }

  val ans = if(n > m+1 || m > n+1) 0L
    else if (n == m) {
      // println(factorial(n) + " " + factorial(m))
      factorial(n) * factorial(m) * 2L % mod
    }
    else {
      factorial(n) * factorial(m) % mod
    }

  println(ans)
}

Measured memory_bytes: 25548
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  int n,m;
  int student[100];
  
  cin>>n>>m;

  for(int i=1;i<=n;++i)
    cin>>student[i];

  for(int i=1;i<=m;++i){
    for(int j=1;j<n;++j){
      if((student[j]%i)>(student[j+1]%i))
	swap(student[j],student[j+1]);
    }
  }

  for(int i=1;i<=n;++i)
    cout<<student[i]<<endl;

}

Measured memory_bytes: 3100
import collections


def main():
    n = int(input())
    a = [int(ele) for ele in input().split()]
    b = collections.deque()

    ct = 1
    for i in range(n):
        if ct % 2 == 1:
            b.append(str(a[i]))
        else:
            b.appendleft(str(a[i]))
        ct += 1

    if ct % 2 == 0:
        print(" ".join(list(b)[::-1]))
    else:
        print(" ".join(list(b)))


if __name__ == "__main__":
    main()


Measured memory_bytes: 32964
# int(input()) # 入力が1つ
# map(int, input().split()) # 入力が複数
# [int(i) for i in input().split()] # 配列で数字
s = input()

if s == 'SUN':
    print(7)
elif s == 'MON':
    print(6)
elif s == 'TUE':
    print(5)
elif s == 'WED':
    print(4)
elif s == 'THU':
    print(3)
elif s == 'FRI':
    print(2)
else:
    print(1)

Measured memory_bytes: 38428
n = int(input())
h = list(map(int, input().split()))
dp = [1000000000+5 for i in range(n)]
dp[0] = 0
for i in range(n):
    for j in range(i+1, i+3):
        if j < n:
            dp[j] = min(dp[j], dp[i] + abs(h[i]-h[j]))
print(dp[n-1])

Measured memory_bytes: 13980
import itertools

N = int(input())

cities = []
for _ in range(N):
  x, y = list(map(int, input().split()))
  cities.append((x, y))

results = 0
count = 0
for items in itertools.permutations(cities):
  count += 1
  length = 0
  for i in range(1, len(items)):
    length += ((items[i][1] - items[i-1][1])**2 + (items[i][0] - items[i-1][0])**2)**0.5
  results += length
print(results/count)

Measured memory_bytes: 3064
import java.util.Scanner;
public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		double a = sc.nextInt();
		double b = sc.nextInt();
		double c = sc.nextInt();
		double d = sc.nextInt();
		int j, m;
		j = (int)Math.ceil(a / c);
		m = (int)Math.ceil(b / d);
		if(j > m) System.out.println(l - j);
		else System.out.println(l-m);
	}
}

Measured memory_bytes: 26052
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>
#include <queue>
#include <iomanip>
#include <set>
//#include <bits/stdc++.h>
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
using namespace std;
#define ALL(X) X.begin(),X.end()
using ll = long long int;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
const int MOD=1000000007;
//const int MOD=998244353;
const int INTMAX=2147483647;
const ll LLMAX=9223372036854775807;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    ll X;
    cin>>X;
    ll a=100;
    ll count=0;
    while(true){
        if(a>=X){
            cout<<count<<endl;
            return 0;
        }
        count++;
        a*=1.01;
    }
    
    return 0;
}


Measured memory_bytes: 3640
#include <stdio.h>
void tos(int a[]);
void ton(int a[]);
void toe(int a[]);
void tow(int a[]);
 
int main(void){
    int d[6],i;
    char o[101];
    for(i=0;i<6;i++){
        scanf("%d",&d[i]);
    }
    scanf("%s",o);
    for(i=0;o[i]!='\0';i++){
        if(o[i]=='S') tos(d);
        if(o[i]=='N') ton(d);
        if(o[i]=='E') toe(d);
        if(o[i]=='W') tow(d);
    }
    printf("%d\n",d[0]);
    return 0;
}
 
void tos(int a[]){
    int t=a[0];
    a[0]=a[4];
    a[4]=a[5];
    a[5]=a[1];
    a[1]=t;
}
void ton(int a[]){
    int t=a[0];
    a[0]=a[1];
    a[1]=a[5];
    a[5]=a[4];
    a[4]=t;
}
void toe(int a[]){
    int t=a[0];
    a[0]=a[3];
    a[3]=a[5];
    a[5]=a[2];
    a[2]=t;
}
void tow(int a[]){
    int t=a[0];
    a[0]=a[2];
    a[2]=a[5];
    a[5]=a[3];
    a[3]=t;
}


Measured memory_bytes: 2112
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll INF=1e9+1;

int main()
{
    ll a,b;
    cin >> a >> b;
    if(a>b){
        cout << a-1 << endl;
    }
    else{
        cout << a << endl;
    }
    return 0;
} 

Measured memory_bytes: 256
import scala.io.StdIn.readLine

object Main {
  val gesIndex = Map("Rock"->0,"Fire"-> 1, "Scissors" -> 2, "Snake" -> 3,
                    "Human"->4, "Tree"->5, "Wolf"->6, "Sponge"->7,
                    "Paper"->8, "Air"->9, "Water"->10, "Dragon"->11,
                    "Devil"->12, "Lightning"->13, "Gun" -> 14)

  def scan(list:Array[Int],i:Int,n:Int):String = {
    if(i==n) "Draw"
    else {
      val win = (list((i+1)%n)-list(i)+15)%15
      val j = if(i>0) i-1 else n-1
      val lose = (list(i)-list(j)+15)%15
      if(win<=7 && lose>7) gesIndex.find(_._2==list(i)).map(_._1).get
      else scan(list,i+1,n)
    }
  }

  def main(args:Array[String]) = {
    var n = 0
    while({n=readLine.trim.toInt;n}!=0) {
      val unsorted = new Array[Int](n)
      for(i<-0 until n)
        unsorted(i) = gesIndex(readLine.trim)
      val list = unsorted.sorted
      println(scan(list,0,list.length))
    }
  }
}

Measured memory_bytes: 53928
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <deque>
#include <set>
#include <iomanip>
#include <utility>
#define ll long long
#define ld long double
using namespace std;

vector<vector<int>> G;
int par[60], depth[60], num[60], cnt=1;
ll path[25];
void dfs(int key){
	for(int i=0; i<G[key].size(); ++i){
		if(par[key]!=G[key][i]){
			par[G[key][i]]=key;
			depth[G[key][i]]=depth[key]+1;
			num[G[key][i]]=cnt;
			++cnt;
			dfs(G[key][i]);
		}
	}
}

int main() {
	int N;
	cin >> N;
	G.resize(N+1);
	for(int i=1; i<N; ++i){
		int a, b;
		cin >> a >> b;
		G[a].emplace_back(b);
		G[b].emplace_back(a);
	}
	dfs(1);
	int M;
	cin >> M;
	for(int i=0; i<M; ++i){
		int u, v;
		cin >> u >> v;
		int now=u;
		while(now>1){
			path[i] ^= (ll) 1<<(num[now]);
			now=par[now];
		}
		now=v;
		while(now>1){
			path[i] ^= (ll) 1<<(num[now]);
			now=par[now];
		}
	}
	ll ans=(ll) 1<<(N-1);
	for(int i=1; i<(1<<M); ++i){
		ll sum=0;
		int ccnt=0;
		for(int d=0; d<M; ++d){
			if(i&(1<<d)){
				sum |= path[d];
				++ccnt;
			}
		}
		int dcnt=N-1;
		for(int d=1; d<N; ++d){
			if(sum&((ll) 1<<d)){
				--dcnt;
			}
		}
		if(ccnt%2==1) ans -= (ll) 1<<dcnt;
		else ans += (ll) 1<<dcnt;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 384
n = int(input())
card = [[False for i in range(13)] for j in range(4)]

for i in range(n) :
    mark, suit = input().split()
    if mark == "S" :
        mark_num = 0
    elif mark == "H" :
        mark_num = 1
    elif mark == "C" :
        mark_num = 2
    elif mark == "D" :
        mark_num = 3
    card[mark_num][int(suit)-1] = True

for j in range(4) :
    for i in range(13) :
        if card[j][i] == False :
            if j == 0 :
                print("S", i+1)
            elif j == 1 :
                print("H", i+1)
            elif j == 2 :
                print("C", i+1)
            elif j == 3 :
                print("D", i+1)


Measured memory_bytes: 5608
// Author : Rifayat Samee (Sanzee)
// Problem :
// Algorithm:

/*

*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define maxval 2*10005
struct Node{
    int w;
    int s;
    ll v;
    bool operator<(const Node &b)const{
        return b.w + b.s > w + s;
    }
};


int main(){

	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
    int n;
    scanf("%d",&n);
    vector<Node>B(n);
    for(int i=0;i<n;i++){
        scanf("%d %d %d",&B[i].w,&B[i].s,&B[i].v);
    }
    sort(B.begin(),B.end());
    vector<ll>P(maxval+1,0);
    for(int i=0;i<n;i++){
        vector<ll>dp(maxval+1);
        dp = P;
        for(int w=0;w<=B[i].s;w++){
            dp[w+B[i].w] = max(P[w+B[i].w],P[w]+B[i].v);
        }
        P = dp;
    }
    ll res = 0;
    for(int w = 0; w<=maxval;w++) res = max(res,P[w]);
    printf("%lld\n",res);
	return 0;
}


Measured memory_bytes: 608
package main 

import (
        "fmt"
        "unicode/utf8"
)

func main () {
        var s, t string 
        an := 0
        fmt.Scan(&s,&t)
        if s == t {
                fmt.Println("Yes")
        }  else if s !=t {
                lo :=utf8.RuneCountInString(s) 
                lp := lo -1
                for i :=0 ; i < lo ; i ++ {
                        s =s[lp:lo]+s[0:lp]
                        if s == t {
                                 an += 1
                        }
                }
                if an == 0 {
                        fmt.Println("No")
                }  else if an != 0 {
                        fmt.Println("Yes")
                }
        }
}


Measured memory_bytes: 512
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String S = sc.next();
		int ans = 0;
		for(int n=2; n<N; n++) {
			int tmp=0;
			ArrayList Xlist = new ArrayList();
			for(int i=0;i<n;i++) {
				if(!Xlist.contains(S.charAt(i)))
					Xlist.add(S.charAt(i));
			}
			String Y = S.substring(n, N);
			for(int i=n;i<N;i++) {
				if(Xlist.contains(S.charAt(i))) {
					tmp++;
					Xlist.remove(Xlist.indexOf(S.charAt(i)));
				}
			}
			if(ans<tmp)
				ans = tmp;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 22996
n = int(input())
L = []
for i in range(n):
    a,b = map(int,input().split())
    L.append([a,b])
import itertools
def dis(p,q,r,s):
    return ((p-r)**2 + (q-s)**2)**0.5
ans = 0
cnt1 = 0
for v in itertools.permutations(L):
    cnt1 +=1
    for i in range(n-1):
        ans +=dis(v[i][0],v[i][1],v[i+1][0],v[i+1][1])
print(ans/cnt1)

Measured memory_bytes: 3064
#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    n: usize,
    p: [usize; n]
    }
    let mut ans = 0;
    for i in 1..n - 1 {
        if p[i - 1] < p[i] && p[i] < p[i + 1]{ans += 1}
        if p[i - 1] > p[i] && p[i] > p[i + 1]{ans += 1}
    }
    println!("{}", ans);
}


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

using namespace std;

int main() {
	char buff[4 + 1];
	for (int i = 1; i <= 3; i++) {
		memset(buff, 0, sizeof(buff));
		scanf("%s", buff);
		printf("%c", buff[i - 1]);
	}
	printf("\n");
	return 0;
}


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

int main ()
{
  int x, y;
  cin >> x;
  cin >> y;

  for (auto i = 0; i <= x; i++) {
    int c = i;
    int t = x - i;
    int leg = 2 * c + t * 4;
    if (leg == y) {
      cout << "Yes\n";
      return 0;
    }
  }
  cout << "No\n";
  return 0;
}


Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
long long int ans=0;
//最大公約数
long long int getgcd(long long n, long long m)
{
  int r;
  if (n > m) {
    long long t = m;
    m = n;
    n = t;
  }
  while ((r = m % n) != 0) {
    m = n;
    n = r;
  }
return n;
}

//nの階乗を計算
long long factorial(long long n){
    long long int answer = 1;
while(n > 1){
  answer *= n;
  n--;
}
    return answer;
}

//組み合わせの数nCrを計算
long long calcNumOfCombination(long long  n, long long r){
    return factorial(n) / (factorial(r) * factorial(n-r));
}
 void yes(){
   printf("Yes\n");
 }

 void no(){
   printf("No\n");
 }

int main(int argc, char* argv[]){
	long long int a = 0, b = 0,c=0;
	scanf("%lld",&a);
  int f=0;
  for (double i = 100.0; i<a;i=floor(i*1.01)) {
    b++;
  }
  printf("%lld\n",b);
  return 0;
}


Measured memory_bytes: 1728
#include <iostream>
#include <map>
using namespace std;
const int maxn = 2e5 + 5;

int an[maxn];
map<long long, long long> mp;

int main(void)
{
	int n;
	cin >> n;
	long long sum = 0;
	for (int i = 1; i <= n; i++) {
		cin >> an[i];
		mp[an[i]]++;
	}
	for (int i = 0; i < mp.size(); i++) {
		if (mp[i] > 1) sum += (mp[i] * (mp[i] - 1)) / 2;
	}
	for (int i = 1; i <= n; i++) {
		if (mp[an[i]] > 1) {
			cout << sum - mp[an[i]] * (mp[an[i]] - 1) / 2 + (mp[an[i]] - 1) * (mp[an[i]] - 2) / 2 << endl;
		}
		else cout << sum << endl;
	}
	return 0;
}

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

using namespace std;

#define int long long

const int N = 2e5 + 77;


int A[N];

int32_t main(){
    int n , mx = 0, ans = 0; cin >> n ;
    for(int i = 0 ; i < n ; ++i){
        cin >> A[i];
        mx = max(mx,A[i]);
        ans += (mx - A[i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5212
#include <iostream>
using namespace std;
int main(){
  int a[4],b[4];
  while(cin >> a[0]){
    for(int i = 1; i < 4 ; i++)cin >> a[i];
    for(int i = 0; i < 4 ; i++)cin >> b[i];
    int hit = 0,brow = 0;
    for(int i = 0 ; i < 4 ; i++ ){
      if(a[i] == b[i])hit++; 
    }
    for(int i = 0 ; i < 4 ; i++ ){
      for(int j = 0 ; j < 4 ; j++ ){
	if(a[i] == b[j]){
	  brow++;
	}
      }
    }
    cout << hit << ' ' << brow - hit << endl;
  }
}

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

using ll = long long;

#define mod 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)
#define INF (1 << 29)

using namespace std;

//long C(long n, long r);
//long long gcd(long long a, long long b);
//long long lcm(long long a, long long b);
 

void solve() {
    int A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;
    vector<int> x, y;
    for(int i = 0; 100*A*i <= F; i++){
        for(int j = 0; 100*A*i+100*B*j <= F; j++){
            x.push_back(100*A*i+100*B*j);
        }
    }
    for(int i = 0; C*i <= F; i++){
        for(int j = 0; C*i+D*j <= F; j++){
            y.push_back(C*i+D*j);
        }
    }
    int X = 0, Y = 0;
    double ans = -1.0;
    for(int i = 0; i < x.size(); i++){
        for(int j = 0; j < y.size(); j++){
            if(x[i]+y[j] <= F && y[j] <= (double)x[i] * (double)E / 100 && ans < (double)y[j] / (x[i] + y[j])) {
                ans = (double)y[j] / (x[i] + y[j]);
                X = x[i];
                Y = y[j];
            }
        }
    }
    cout << X + Y << " " << Y << endl;
}
 
int main() {
    solve();
    return 0;
}

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

int main(){
  int n;
  scanf("%d",&n);
  int h[n];
  int mx=0;
  rep(i,n){
    scanf("%d",&h[i]);
    mx = max(mx,h[i]);
    if(mx-h[i]>1){
      printf("%s","No");
      return 0;}
  }
  printf("%s","Yes");
}

Measured memory_bytes: 640
#include <stdio.h>          // putchar(), scanf()
#include <stdbool.h>

int
main(int argc, char **argv)
{
	const char abacus[10][8] = {"* = ****",  "* =* ***",  "* =** **",  "* =*** *",  "* =**** ",  " *= ****",  " *=* ***",  " *=** **",  " *=*** *",  " *=**** "};
	int x;

	bool f = false;
	while (scanf("%d", &x) != EOF)
	{
		int a[5];
		for (int i = 4; i >= 0; --i)
		{
			a[i] = x % 10;
			x /= 10;
		}

		if (f)
			putchar('\n');

		for (int i = 0; i < 8; ++i)
		{
			for (int j = 0; j < 5; ++j)
				putchar(abacus[a[j]][i]);

			putchar('\n');
		}

		f = true;
	}

	return 0;
}

Measured memory_bytes: 1780
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
#include <queue>
#include <cassert>
#include <numeric>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
//#define int ll
typedef long long ll;

const int md = 1000000007;
const int INF = 1<<30;
using namespace std;

string yn(bool x){
    return x ? "YES" : "NO";
}

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

    ll ans = 1;
    int m = 0;

    if(a >= b-2){
        ans += n;
        cout << ans << endl;
        return 0;
    }

    for(int i = n ; i > 0 ; i--){
        if(m == 1){
            ans += b;
            m--;
            continue;
        }

        if(ans >= a && i >= 2){
            ans -= a;
            m++;
            continue;
        }

        ans++;
    }

    cout << ans << endl;
}

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

int main(){
    int h,w;
    string s[30][30];

    cin>>h>>w;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin>>s[i][j];
        }
    }

    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(s[i][j]=="snuke"){
                cout<<char('A'+j);
                cout<<i+1<<endl;
                return 0;
            }
        }
    }
}

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

using namespace std;

using ll = int_fast64_t;
constexpr ll llmax = INT_FAST64_MAX; // std::numeric_limits<int_fast64_t>::max()
constexpr ll llmin = INT_FAST64_MIN; // std::numeric_limits<int_fast64_t>::min()
using ull = uint_fast64_t;
constexpr ull ullmax = UINT_FAST64_MAX; // std::numeric_limits<uint_fast64_t>::max()

#define FOR(i, b, e) for (int i = (b); i < (e); ++i)
#define RFOR(i, b, e) for (int i = ((e) - 1); (b) <= i; --i)
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define RREP(i, N) for (int i = ((N) - 1); 0 <= i; --i)
#define scanInt(x) int x; scanf("%d", &(x)); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &(x)); getchar();
#define scanVecInt(A, N) vector<int> A(N); REP(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); REP(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    scanInt(N);
    scanInt(K);
    vector<int> flags(N, 0);
    REP(k, K){
        scanInt(di);
        scanVecInt(A, di);
        for (auto& a : A){
            flags[a - 1] = 1;
        }
    }
    int result = 0;
    for (auto& f : flags){
        if (f == 0) ++result;
    }
    cout << result << endl;
}


Measured memory_bytes: 3692
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String[] c = new String[n];
    String[] results = { "AC", "WA", "TLE", "RE" };
    int[] resultCnt = { 0, 0, 0, 0 };
    for (int cnt = 0; cnt < n; cnt++) {
      c[cnt] = sc.next();
      switch (c[cnt]) {
        case "AC":
          resultCnt[0] += 1;
          break;
        case "WA":
          resultCnt[1] += 1;
          break;
        case "TLE":
          resultCnt[2] += 1;
          break;
        case "RE":
          resultCnt[3] += 1;
          break;
      }
    }
    for (int cnt = 0; cnt < 4; cnt++) {
      System.out.println(results[cnt] + " x " + resultCnt[cnt]);
    }
    sc.close();
  }
}

Measured memory_bytes: 64928
import java.util.*;
import java.lang.*;
import java.io.*;
class Pair<E,F>{
    E first;
    F second;
    public Pair(E first, F second){
        this.first=first;
        this.second=second;
    }
    public E getFirst(){return first;}
    public F getSecond(){return second;}
    public String toString(){
        return "<"+first.toString()+","+second.toString()+">";
    }
    public int hashCode(){
        return first.hashCode()*30011+second.hashCode()+2;
    }
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Pair another = (Pair) obj;
        return this.getFirst().equals(another.getFirst())&&this.getSecond().equals(another.getSecond());
    }
}
class Counter<T> extends HashMap<T,Integer>{
    public Counter(){
        super();
    }
    public Integer get(Object elm){
        return getOrDefault(elm,0);
    }
    public void add(T elm){
        put(elm, get(elm)+1);
    }
}
class UnionFind{
    int size;
    int[] parent;
    int[] height;
    public UnionFind(int size){
        this.size = size;
        parent = new int[size];
        height = new int[size];
        for(int i=0;i<size;i++){
        	parent[i]=i;
        	height[i]=0;
        }
    }
    private boolean isRoot(int node){
        return node==parent[node];
    }
    public int getRoot(int node){
        if(isRoot(node)) return node;
        else{
        	parent[node] = getRoot(parent[node]);
        	return parent[node];
        }
    }
    public void union(int node1, int node2){
        if(height[node1]>height[node2])parent[getRoot(node2)] = getRoot(node1);
        else parent[getRoot(node1)] = getRoot(node2);
    }
    public boolean find(int node1, int node2){
        return getRoot(node1)==getRoot(node2);
    }
    public int countGroup(){
        int ans = 0;
        for(int i=0;i<size;i++) if(isRoot(i)) ans++;
        return ans;
    }
}
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int L = sc.nextInt();
        UnionFind road = new UnionFind(N);
        UnionFind rail = new UnionFind(N);
        for(int k=0;k<K;k++){
        	int p = sc.nextInt()-1;
        	int q = sc.nextInt()-1;
        	road.union(p,q);
        }
        for(int l=0;l<L;l++){
        	int r = sc.nextInt()-1;
        	int s = sc.nextInt()-1;
        	rail.union(r,s);
        }
        
        Counter<Pair<Integer,Integer>> count = new Counter<>();
        for(int n=0;n<N;n++){
        	Pair<Integer,Integer> root = new Pair<>(road.getRoot(n),rail.getRoot(n));
        	count.add(root);
        }
        for(int n=0;n<N;n++){
        	Pair<Integer,Integer> root = new Pair<>(road.getRoot(n),rail.getRoot(n));
        	System.out.print(count.get(root));
        	if(n==N-1)System.out.println();
        	else System.out.print(" ");
        }
    }
}


Measured memory_bytes: 139788
#include <iostream>

using namespace std;
int main() {
    int a,b,c,ans;
    ans=0;
    cin >> a>>b>>c;
    if(a>=b&&a>=c)ans+=a*10+b+c;
    else if(b>=a&&b>=c)ans+=b*10+a+c;
    else ans+=c*10+b+a;
    std::cout <<ans << std::endl;
    return 0;
}

Measured memory_bytes: 256
a = list(input())

enki = set(["A", "C", "G", "T"])
cnt = 0
cntmax = 0
for i in a:
  if i in enki:
    cnt += 1
  else:
    if cntmax < cnt:
      cntmax = cnt
    cnt = 0
if cntmax < cnt:
  cntmax = cnt

print(cntmax)

Measured memory_bytes: 3060
// author: Saman Mahdanian
#include <iostream>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <algorithm>

using namespace std;
typedef pair <int, int> pii;

const int N = 1e5 + 10;

#define int long long
int x, y, t, n, m, l, r, v, u, cnt[N], a[N], p[N];

int32_t main() {
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> v >> u;
		v--; u--;
		cnt[v]++;
		cnt[u]++;
	}
	for (int i = 0; i < n; i++)
		if (cnt[i] & 1) {
			cout << "NO" << endl;
			return 0;
		}
	cout << "YES" << endl;
}

// SamMHD :: Nov8-2018 :: Another No-Feeling Contest...

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define printp(x,n) for(int i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e9)
using namespace std;
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;
typedef struct{
    ll to;
    ll cost;
} edge;
typedef pair<ll, ll> lpair;
void comb(vector< vector<ll> > &v){
    rep(i,0,v.size()){
        v[i][0] = 1;
        v[i][i] = 1;
    }
    rep(i,1,v.size()){
        rep(j,1,i){
            v[i][j] = v[i-1][j-1] + v[i-1][j];
        }
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,A,B;
    ll v[55];
    cin >> N >> A >> B;
    rep(i,0,N){
        cin >> v[i];
    }
    vector< vector<ll> > nck(N+1, vector< ll >(N+1,0));
    comb(nck);
    sort(v,v+N, greater<ll>());
    double ave_max = 0.0;
    rep(i,0,A){
        ave_max += v[i];
    }
    ave_max /= A;
    ll cnt_part = 0, cnt_all = 0;
    ll ans = 0;
    rep(i,0,N){
        if(v[A-1] == v[i]){
            cnt_all++;
            if(i <= A-1){
                cnt_part++;
            }
        }
    }
    ans += nck[cnt_all][cnt_part];
    rep(i,A+1,B+1){
        if(v[i-1] == v[0]){
            ans += nck[cnt_all][i];
        }
    }
    printf("%lf\n", ave_max);
    printf("%lld\n", ans);
    //vector< pair<double, ll> > lp;
    //rep(i,A,B+1){
    //    ll val = v[i-1];
    //    ll cnt = 0;
    //    ll cnt_a = 0;
    //    rep(j,0,N){
    //        if(v[j] == val){
    //            cnt++;
    //        }
    //    }
    //    rep(j,0,i){
    //        if(v[j] == val){
    //            cnt_a++;
    //        }
    //    }
    //    ll ave_tmp = 0.0;
    //    rep(j,0,i){
    //        ave_tmp += v[j];
    //        print(ave_tmp);
    //    }
    //    print("");
    //    double ave = double(ave_tmp) / double(i);
    //    printf("%.10lf\n", ave);
    //    ll num = nck[cnt][cnt_a];
    //    lp.push_back(make_pair(ave, num));
    //}
    //sort(lp.begin(), lp.end(), greater< pair<double, ll> >());
    //ll ans = lp[0].second;
    //rep(i,1,lp.size()){
    //    if(lp[0].first == lp[i].first){
    //        ans += lp[i].second;
    //    }
    //}
    //cout << fixed << lp[0].first << endl;
    //printf("%.10lf\n", lp[0].first);
    //printf("%lld\n", ans);



}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**7)
n = int(input())
people = []
shogens = [[]for i in range(n)]
def check():
    for i in range(n):
        if i not in people:continue
        for shogen in shogens[i]:
            person = shogen[0]
            honest = shogen[1]
            if honest and person not in people:return False
            if (not honest) and person in people:return False
    return True
        
            
            
            
        
for i in range(n):
    a = int(input())
    for j in range(a):
        p,q = map(int,input().split())
        p -= 1
        shogens[i].append((p,q))
def dfs(d,people):
    if d == n:
        
        if check():
            
            return len(people)
        else:
            return 0
    res = dfs(d+1,people)
    people.append(d)
    res = max(res,dfs(d+1,people))
    people.pop()
    return res
print(dfs(0,people))


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define divceil(A, B) ((A + (B - 1)) / B)
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define CERR if(false) cerr

typedef long long ll;

using namespace std;

int main(){

    int n,m,r,tmp;
    cin >> n >> m >> r;

    vector<int> rv;

    rep(i,r){
        cin >> tmp;
        rv.pback(tmp);
    }

    vector<vector<int>> d(n + 1, vector<int>(n + 1, INT_MAX / 2));

    rep(i,m){
        int a,b,c;
        cin >> a >> b >> c;

        d[a][b] = c;
        d[b][a] = c;
    }

    for(int k = 1; k <= n; k++){
        for(int i = 1; i <= n; i++){
            for(int j = 1; j <= n; j++){
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }

    priority_queue<pair<int,pair<int,int>>, vector<pair<int,pair<int,int>>>, greater<pair<int,pair<int,int>>>> pq;
    int state = 1;

    rep(i,r){
        pq.push(mpair(0, mpair(state, rv[i])));
        state *= 2;
    }

    while(!pq.empty()){

        int cost = pq.top().first;
        int state = pq.top().second.first;
        int town = pq.top().second.second;

        bool b = true;

        rep(i,r){
            if(!(state & (1<<i))){
                b = false;
                
                pq.push(mpair(cost + d[town][rv[i]], mpair(state | (1<<i), rv[i])));
            }
        }

        if(b){
            cout << cost << endl;
            break;
        }

        pq.pop();

    }  

    return 0;
}

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

#define INF 1e9
using namespace std;

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

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

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

typedef long long ll;


int facctorialMethod(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}
int main() {
    int N;
    cin >> N;
    vector<pair<int, int>> v(N);
    REP(i, N) {
        int x, y;
        cin >> x >> y;
        v[i] = make_pair(x, y);
    }
    long double sumDis=0;
    long double count=0;

    REP(i,N) {
        FOR(j,i+1,N) {
            sumDis+=sqrt(pow(abs(v[i].first-v[j].first),2)+pow(abs(v[i].second-v[j].second),2));
            // cout << "s" << sumDis << endl;
            count++;
        }
    }
    sumDis*=2;
    sumDis*=facctorialMethod(N-1);
    // cout << count << endl;
    // cout << sumDis << endl;
    cout << setprecision(15) << sumDis/facctorialMethod(N) << endl;


    return 0;
}


Measured memory_bytes: 256