akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch DivGame | diff DivGame.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address DivGame.cpp && ./a.out

/*

 5/31/2020

 5:15-

 */

LL N;
vector<LL> primeFactors(LL n) {
  assert(n>=1);
  vector<LL> res;
  for(LL p=2; p*p<=n; ++p) while(n%p==0) {
    res.push_back(p);
    n/=p;
  }
  if(n>1) res.push_back(n);
  return res;
}
void solve() {
  auto ps=primeFactors(N);
  map<LL,int> cnt;
  FORR(p,ps) cnt[p]++;
  LL res=0;
  FORR(kvp, cnt) {
    int x=1,cur=kvp.second;
    while(cur>=x) cur-=x,++x,++res;
  }
  cout<<res<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;

  cin>>N;
  solve();

  return 0;
}


Measured memory_bytes: 3660
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int x, a, b;
	cin >> x >> a >> b;

	if (min(abs(a - x), abs(b - x))==abs(a-x)) {
		cout << "A" << "\n";
	}
	else {
		cout << "B" << "\n";
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll INF = 1e15;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// __uint128_t
const ll MOD = 1e9+7;

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

    vector<ll> V(N); for(int i = 0; i < N; i++) cin >> V[i];

    ll Min = 1; 
    ll Max = 1e9+1;
    ll Mid;
    ll ans = 1e9+1;
    while(Min < Max){
        Mid = (Min + Max) / 2;
        ll cnt = 0;
        for(int i = 0; i < N; i++){
            cnt += (V[i] + Mid -1) / Mid-1;
        }
        if(cnt <= K) {
            Max = Mid;
            ans = min(ans, Mid);
        }
        else Min = Mid+1;
        //cout << cnt << " "  << K << " " << Mid << endl;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4756
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <set>

#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()

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

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 A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const int INF = 0x3fffffff;

bool flag;

int B(string &s, int &n){
	int ret = 0;
	while(1){
		if( !isdigit(s[n]) ){ break; }
		else if( s[n] == '0' ){ n++; ret<<=1; }
		else if( s[n] == '1' ){ n++; ret<<=1; ret += 1; }
	}
	//cout << "B " << ret << "  " << flag << endl;
	return ret;
}

int N(string &s, int &n){
	if( !isdigit(s[n]) ){ flag = false; }
	else if( s[n] == '0' ){ n++; return 0; }
	else if( s[n] == '1' ){ return B(s, n); }
	//cout << "flag N" << endl;
	return 0;
}

int E(string &s, int &n, int ret=0, int d=1);
int F(string &s, int &n){
	int ret;
	if( isdigit(s[n]) ){ ret = N(s, n); }
	else if( s[n] == '-' ){ n++; ret = -F(s, n); }
	else if( s[n] == '(' ){
		n++;
		ret = E(s, n);
		if( s[n] == ')' ) n++;
		else flag = false;
	} else {
		//cout << "flag F" << endl;
		flag = false;
	}
	//cout << "F " << ret << "  " << flag << endl;
	return ret;
}

int T(string &s, int &n){
	int ret = F(s,n);
	if( s[n] == '*' ){ n++; ret *= T(s, n); }
	//cout << "T " << ret << "  " << flag << endl;
	return ret;
}

int E(string &s, int &n, int ret, int d){
	ret += T(s,n) * d;
	if( s.size() <= n ){}
	else if( s[n] == '+' ){ n++; ret = E(s, n, ret,  1); }
	else if( s[n] == '-' ){ n++; ret = E(s, n, ret, -1); }
	//cout << "E " << ret << "  " << flag << endl;
	return ret;
}

bool Q(string &s){
	flag = true;
	int n=0;
	int l = E(s,n);
	//cout << "l = " << l << endl;
	if( s[n] == '=' ) n++;
	else return false;
	int r = E(s,n);
	//cout << "r = " << r << endl;
	if( s[n] != '$' ) flag = false;
	return flag && l == r;
}

string ope = "01+-*()=";
int main(){
	set<string> ans;
	string S;
	cin >> S;
	
	vector<char> v;
	for(char c: S){
		if( 'A' <= c && c <= 'Z' ) v.push_back(c);
		if( 'a' <= c && c <= 'z' ) v.push_back(c);
	}
	sort(all(v));
	v.erase( unique(all(v)), v.end() );
	if( v.size() > 8 ){
		cout << 0 << endl;
		return 0;
	}

	sort( all(ope) );
	do{
		char mp[127]={};
		rep(i,v.size()) mp[v[i]] = ope[i];
		string s;
		for(char c: S) s += (mp[c] ? mp[c] : c);
		s += '$';
		//cout << s << endl;
		if( Q(s) ) ans.insert(s);
	}while( next_permutation(all(ope)) );

	//for(auto p: ans) cout << p << endl;
	cout << ans.size() << endl;

	return 0;
}

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

int ones(int n){
  int count=0;
  while(n!=0){
    if(n & 1) count++;
    n >>= 1;
  }
  return count;
}

int main(){
  int N;
  cin >> N;
  vector<pair<int, int> > T[16];
  for(int i=1; i<=N; i++){
    int A; cin >> A;
    for(int j=1; j<=A; j++){
      int x, y; cin >> x >> y;
      T[i].push_back(make_pair(x, y));
    }
  }
  int ans=0;
  for(int i=1; i< (1<<N); i++){
    bool judge = true;
    for(int j=1; j<=N; j++){
      if(!(i & (1<<(j-1)))) continue;
      for(int k=0; k<T[j].size(); k++){
        if(((i>>(T[j][k].first-1))&1)^T[j][k].second){
          judge = false;
        }
      }
    }
    if(judge) ans=max(ans, ones(i));
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val inputs = readLine()!!.split(" ").map { it.toInt() }

    var post = Int.MAX_VALUE
    for (i in n-1 downTo 1) {

        var now = inputs[i]

        if (now - 1 > post) {
            println("No")
            return
        }

        if (now - 1 == post) {
            post = now - 1
        } else {
            post = now
        }
    }

    println("Yes")
}

Measured memory_bytes: 57916
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define inf 1e9
#define mod 1000000007
#define ff first
#define ss second

void solve()
{
	int k;
	string s;
	cin >> k >> s;
	if (s.length() <= k)
		cout << s;
	else
	{
		string ans = s.substr(0, k) + "...";
		cout << ans;
	}

}

signed main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	solve();
	return 0;
}


Measured memory_bytes: 3648
package main

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

func main() {
	io := NewIo(os.Stdin, os.Stdout)
	defer io.Flush()
	k := io.NextInt()
	ans := 0
	for a := 1; a <= k; a++ {
		for b := 1; b <= k; b++ {
			gcd := Gcd(a, b)
			for c := 1; c <= k; c++ {
				ans += Gcd(gcd, c)
			}
		}
	}
	io.Println(ans)
}

// Gcd returns greatest common divisor of a and b
func Gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return Gcd(b, a%b)
}

// Io is I/O object
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

// NewIo returns a new Io instance
func NewIo(r io.Reader, w io.Writer) *Io {
	return &Io{
		reader: bufio.NewReader(r),
		writer: bufio.NewWriter(w),
	}
}

// Flush flushes writer
func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

// NextLine scans a line from stdin
func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// Next return a word from stdin
func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

// NextInt returns an integer from stdin
func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

// Println is a wrapper of fmt.Fprintln
func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}


Measured memory_bytes: 1800
// AOJ 1029: Traffic Analysis
// 2017.8.19 bal4u@uu
// 2017.12.15

#include <stdio.h>

int a[10001], b[10001];
char buf[80005], *p;

int getint()
{
	int n = 0;
	while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	p++;
	return n;
}

int main()
{
	int n, m, i, j, s, t, ans;

	while (1) {
		fgets(p=buf, 15, stdin);
		n = getint(), m = getint();
		if (!n && !m) break;
		
		if (n > 0) {
			fgets(p=buf, sizeof(buf), stdin);
			for (i = 0; i < n; i++) a[i] = getint();
		}
		if (m > 0) {
			fgets(p=buf, sizeof(buf), stdin);
			for (i = 0; i < m; i++) b[i] = getint();
		}
		
		ans = i = j = 0, s = 0, t = -1;
		while (i < n || j < m) {
			if (i < n) {
				if (s == a[i]) i++;
				if (i < n) t = a[i];
			}
			if (j < m) {
				if (s == b[j]) j++;
				if (j < m && (t < 0 || b[j] < t)) t = b[j];
			}
			if (t >= 0) {
				if (i < n && t == a[i]) i++;
				if (j < m && t == b[j]) j++;
				if (t - s > ans) ans = t - s;
				s = t;
				t = -1;
			}
		}
		if (t >= 0 && t - s > ans) ans = t - s;
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 1804
using System;
using System.Collections.Generic;
using System.Linq;

class A
{
    static int[] Read() => Console.ReadLine().Split().Select(int.Parse).ToArray();
    static void Main()
    {
        var a = Console.ReadLine();
        Console.WriteLine(a[^1] == 's' ? a + "es" : a + "s");
    }
}

Measured memory_bytes: 25792
s=input()
l=len(s)
#print(l)

ans=1

gen=1
temp=s[0]
gr=[]
gr.append(temp)
while(gen<l):
    if(s[gen]!=temp):
        ans+=1
        temp=s[gen]
        gen+=1
    else:
        if(gen+1<l):
            ans+=1
            temp=s[gen]+s[gen+1]
            gen+=2
        else:
            ans+=1
            temp=s[gen]
            gen+=1
    #print(temp)
    gr.append(temp)
#print(ans)
#print(gr)
if(gr[-1]==gr[-2]):
    gatai=gr[-2]+gr[-1]
    if(gr[-3]==gatai):
        ans-=1
    else:
        ans-=1

print(ans)


#if(l%2==1):
    
#    s=["A"]*(l+1)
#    for i in range(l):
#        s[i+1]=S[i]  
#else:
#    s=["A"]*l
#    for i in range(l):
        
#        s[i]=S[i]

#print(s)

#kl=len(s)

#temp=""
#tl=len(temp)

#for i in range(kl//2):
#    print(i)
#    still=True
#    if(temp==s[i*2]):
#        ans+=1
#        temp=s[i*2]+s[i*2+1]
#        still=False


    
#    print(temp)

Measured memory_bytes: 8424
/*
    ID: sixathofpain
    TASK: friday
    LANG: C++   

*/


//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define ff first
#define ss second
#define setbits(x) __builtin_popcount(x)
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 1000000007;
const int N = int(3e5) + 999;
#define int long long int

typedef pair<int, int> pii;

bool comp(pii &a,pii &b){
    return (a.ff+a.ss)<(b.ff+b.ss);
}
bool comp2(pii &a,pii &b){
    return (a.ff-a.ss)<(b.ff-b.ss);
}


int32_t main(){
    IOS;
    
    // freopen("friday.in","r",stdin);
    // freopen("friday.out","w",stdout);

    int n;
    cin>>n;
    vector<int> a(n),b(n);
    for(auto &it:a)
        cin>>it;
    for(auto &it:b)
        cin>>it;
    map<int,int> cnta,cntb;

    for(int i=0;i<n;i++){
        cnta[a[i]]++;
        cntb[b[i]]++;
    }

    for(int i=0;i<n;i++){
        if(cntb.count(a[i])==0)
            continue;
        if(min(cnta[a[i]],cntb[a[i]])>n/2){
            cout<<"No"<<endl;
            return 0;
        }
        
    }

    reverse(all(b));
    int l=-1,r=-1;
    for(int i=0;i<n;i++){
        if(a[i]==b[i]){
            l=i;
            break;
        }
    }
    for(int i=n-1;i>=0;i--){
        if(a[i]==b[i]){
            r=i;
            break;
        }
    }
    if(l==-1){
        cout<<"Yes"<<endl;
    for(int i:b)
        cout<<i<<" ";
    return 0;
    }
    int x = a[l];
    for(int i=0;i<n;i++){
        if(a[i]!=x and b[i]!=x and l<=r){
            swap(b[i],b[l]);
            l++;
        }
    }
    if(l<=r){
        cout<<"No"<<endl;
        return 0;

    }
    cout<<"Yes"<<endl;
    for(int i:b)
        cout<<i<<" ";



    return 0;
}

Measured memory_bytes: 31340
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;
ll MOD=1000000007;
int main(){
  ll n,k;
  cin>>n>>k;
  vector<ll> a(n+1);
  rep2(i,1,n+1) cin>>a[i];
  
  rep2(i,k+1,n+1){
    if(a[i]>a[i-k]) cout<<"Yes"<<endl;
 else cout<<"No"<<endl;
  }
return 0;
}

Measured memory_bytes: 4836
#include <iostream>
int main() {
	int a, b;
	std::cin >> a >> b;
	if (a < b) {
		std::cout <<"a < b" << std::endl;
	}
	else if (a > b) {
		std::cout << "a > b" << std::endl;
	}
	else {
		std::cout << "a == b" << std::endl;
	}
	return 0;
}


Measured memory_bytes: 3060
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds; 

#define int long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define f first
#define s second
#define sz(x) (int)x.size()
#define endl '\n'
#define forn(i,n) for(int i=0;i<n;++i)
#define fore(i,l,r) for(int i=int(l);i<=int(r);++i)
#define rep(i,begin,end) for(__typeof(end) i=(begin);i!=(end);i++)
#define fill(a,value) memset(a,value,sizeof(a));
#define gcd(a,b) __gcd((a),(b))
#define watch1(x) cout << (x) << endl
#define watch2(x,y) cout << (x) << " " << (y) << endl
#define watch3(x,y,z) cout << (x) << " " << (y) << " " << (z) << endl
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld; 
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> oset;

// find_by_order(k) returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;

const int mod = 1e9 + 7;
const int inf = 9e18;
const int N = 1e5 + 5;

int i,n,m,h[N];
vi g[N];

void solve(){
    cin>>n>>m;
    for(i=1;i<=n;++i){
        cin>>h[i];
    }
    for(i=0;i<m;++i){
        int a,b;
        cin>>a>>b;
        g[a].pb(b);
        g[b].pb(a);
    }
    int ans=0;
    for(i=1;i<=n;++i){
        int ok=1;
        for(int j:g[i]){
            if(h[i]<=h[j]){
                ok=0;
                break;
            }
        }
        ans+=ok;
    }
    cout<<ans;
}

signed main(){
    fastio;
    int t;
    //cin>>t;
    t=1;
    while(t--){
        solve();
        cout<<endl;
    }
    return 0;
}

Measured memory_bytes: 10248
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(ll i = n;i >= 0;--i)
#define FOR(i,m,n) for(ll i = m, i##_len=(n);i <i##_len; ++i)
#define all(x) (x).begin(),(x).end()
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; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;
 
int main(void)
{
    int N;
    cin >> N;
    int x;
    x= N%2;
    if(x!=0){
        cout <<N/2+1<<endl;
    }
    else{
        cout << N/2<<endl;
    }


    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
    
using namespace std;
    
int main(){
    int n,x;
    scanf("%d",&n);
    
    for(int i = 1; i<= n; i++)
    {
        if(i%3 == 0){
            printf(" %d",i);
        }else{
            x = i;
            do{
                if(x%10 == 3){
                    printf(" %d",i);
                    break;
                }
                x /=10;
            }while(x);
        }
    }
    printf("\n");
}


Measured memory_bytes: 2704
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = sc.next();
        String c = sc.next();
        String s = "" + a.charAt(0) + b.charAt(1) + c.charAt(2);
        System.out.println(s);
    }
}


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

int main(){
	int X,Y;
	cin >> X >> Y;
	cout  << X + Y / 2 << endl;
	return 0;
}

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

bool solve(int i, string s) {
    if (i == s.size()) return true;
    bool a, b, c, d;
    a = b = c = d = false;
    if (s.substr(i, 5) == "dream") a = solve(i+5, s);
    if (s.substr(i, 7) == "dreamer") b = solve(i+7, s);
    if (s.substr(i, 5) == "erase") c = solve(i+5, s);
    if (s.substr(i, 6) == "eraser") d = solve(i+6, s);
    return a || b || c || d;
}

int main() {
    string s;
    cin >> s;
    if (solve(0, s)) printf("YES\n");
    else printf("NO\n");

    return 0;
}

Measured memory_bytes: 2332
using System;
using System.Collections.Generic;
using System.Linq;



namespace CSharpSample01
{

    
    class Program
    {

        static void Solve(int H, int W, int[,] coin)
        {
            List<string> ope = new List<string>();
            int ope_cnt = 0;

            for(int i = 1; i <= H - 1; i++)
            {
                for(int j = 1; j <= W; j++)
                {
                    if(coin[i, j] % 2 == 1)
                    {
                        if(i + 1 <= H)
                        {
                            coin[i, j]--;
                            coin[i + 1, j]++;
                            ope_cnt++;
                            ope.Add($"{i} {j} {i + 1} {j}");
                        }
                    }
                }
            }

            for(int j = 1; j <= W - 1; j++)
            {
                if(coin[H, j] % 2 == 1)
                {
                    coin[H, j]--;
                    coin[H, j + 1]++;
                    ope_cnt++;
                    ope.Add($"{H} {j} {H} {j + 1}");
                }
            }

            Console.WriteLine(ope_cnt);
            foreach(string s in ope)
            {
                Console.WriteLine(s);
            }

        }
        

        static void Main(string[] args)
        {
            //入力1(H, W)
            string[] input = Console.ReadLine().Split(' ');
            int H = int.Parse(input[0]);
            int W = int.Parse(input[1]);

            //入力2(coin)
            int[,] coin = new int[H + 1, W + 1];
            for(int i = 1; i <= H; i++)
            {
                input = Console.ReadLine().Split(' ');
                for(int j = 1; j <= W; j++)
                {
                    coin[i, j] = int.Parse(input[j - 1]);
                }
            }

            Solve(H, W, coin);
        }
    }

}

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


int main(){
    double t,x;
    cin >> t >> x;
    cout << t/x << endl;
    return 0;
}


Measured memory_bytes: 256
import math
n, a, b = list(map(int, input().split()))
v = list(map(int, input().split()))
v.sort(reverse = True)
ans = 0
many = 0
for i in range(a, b + 1) :
	vsumany = sum(v[:i])
	ansi = vsumany / (i)
	if ans <= ansi :
		ans = ansi
		ci = v.count(v[i - 1])
		cin = v[:i].count(v[i - 1])
		m = math.factorial(ci)//math.factorial(cin)//math.factorial(ci-cin)
		many += m
print(ans)
print(many)


Measured memory_bytes: 39536
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;
typedef pair<int,int> P;

ll T[100010],A[100010];
ll H[100010],c[100010];

int main(void){
	int i;

	cin.tie(0);
	ios_base::sync_with_stdio(false);

	int N;
	cin >> N;
	for(i=1;i<=N;i++) cin >> T[i];
	for(i=1;i<=N;i++) cin >> A[i];
	if(N==1){
		if(T[1]!=A[1]){
			cout << 0 << endl;
			return 0;
		}
	}

	H[1]=T[1]; c[1]=1;
	H[N]=A[N]; c[N]=1;
	for(i=2;i<=N;i++){
		if(T[i]>T[i-1]){
			H[i]=T[i]; c[i]=1;
		}else{
			H[i]=T[i];
		}
	}

	bool f=true;
	for(i=N-1;i>=1;i--){
		if(A[i]>A[i+1]){
			if(c[i]==1){
				if(H[i]!=A[i]){
				f=false; break;
				}
			}else{
				H[i]=A[i]; c[i]=1;
			}

		}else{
			if(c[i]==1){
				if(H[i]>A[i]){
				f=false; break;
				}
			}else{
				H[i]=min(H[i],A[i]);
			}
		}
	}

	if(!f){
		cout << 0 << endl;
		return 0;
	}


	ll m=1e9+7;
	ll ans=1;
	for(i=1;i<=N;i++){
		if(c[i]==0){
			ans=(ans*H[i])%m;
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
#define ll long long
#define ALL(x) x.begin(),x.end()
#define MOD (1000000000+7)
using namespace std;
#define PI 3.14159265359
#define tMOD 998244353
#define mkpr(x,y) make_pair(x,y)

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

 vector<ll> A(N);
 vector<ll> B(N);

 for(ll i=0;i<N;i++){
   cin>>A[i]>>B[i];
 }

ll numH[10500];
for(ll i=0;i<10400;i++){
   numH[i] = 1e14;
 }

 numH[0] = 0;


 for(ll i=0;i<100010;i++){
    for(ll j=0;j<N;j++){
    if(i+A[j]>10050){
      numH[10050] = min(numH[10050]+B[j],numH[10050]);
    }
    else
    numH[i+A[j]] = min(numH[i]+B[j],numH[i+A[j]]);
    }
 }

 
 ll ans = numH[H];

 ans = *min_element(numH+H,numH+10060);
 

 cout<<ans<<endl;
 /*
 cout<<endl;
 for(ll i=0;i<10;i++){
   cout<<numH[i]<<endl;
 }
 */

}

Measured memory_bytes: 384
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int n,m;
int a[100001];
int f[100001];
bool b[100001];
int ans=0;

int main(){
	cin>>n>>m;
	memset(b,false,sizeof(b));
	for (int i=0;i<m;i++){
		cin>>a[i];
		f[a[i]]=0;
		b[a[i]]=true;
	}
	f[0]=1;
	if (!b[1])f[1]=1;
	for (int i=2;i<=n;i++){
		if (!b[i])f[i]=(f[i-1]+f[i-2])%1000000007;
		else f[i]=0;
	}
	cout<<f[n]%1000000007<<endl;
	return 0;
}

Measured memory_bytes: 1152
n = input()
n = list(n)
m = len(n) 
A = 0
if m % 2 == 0:
    K = int(m/2)
    a = n[0:K]
    n.reverse()
    b = n[0:K]
else:
    K = int((m - 1) / 2)
    a = n[0:K]
    n.reverse()
    b = n[0:K]
for i, value in enumerate(a):
    if value != b[i]:
        A = A + 1

print(A)


Measured memory_bytes: 3064
tbl = [[0 for i in range(13)] for j in range(4)]

num = int(input())

for count in range(num):
    list = input().split()
    if list[0] == 'S':
        x = int(list[1])
        tbl[0][x-1] = 1
    if list[0] == 'H':
        x = int(list[1])
        tbl[1][x-1] = 1
    if list[0] == 'C':
        x = int(list[1])
        tbl[2][x-1] = 1
    if list[0] == 'D':
        x = int(list[1])
        tbl[3][x-1] = 1

for i, row in enumerate(tbl):
    for j, elem in enumerate(row):
        if tbl[i][j] == 0:
            if i == 0:
                print("S", end = " ")
                print(j+1)
            if i == 1:
                print("H", end = " ")
                print(j+1)
            if i == 2:
                print("C", end = " ")
                print(j+1)  
            if i == 3:
                print("D", end = " ")
                print(j+1) 


Measured memory_bytes: 5616
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] L = new int[2*n];
		for(int i=0;i<2*n;i++){
			L[i] = sc.nextInt();
		}
		Arrays.sort(L);
		int res = 0;
		for(int i=0;i<2*n;i+=2){
			res += L[i];
		}
		
		System.out.println(res);
	}
}


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

#define dforsn(i,s,n) for(int i=int(n-1);i>=int(s);i--)
#define forsn(i,s,n) for(int i=int(s);i<int(n);i++)
#define forn(i,n) for(int i=0;i<int(n);i++)
#define D(a) cerr << #a << " = " << a << endl
#define all(a) a.begin(),a.end()
#define si(a) int((a).size())
typedef pair<int,int> pii;
typedef long long int ll;
typedef vector<int> vi;
#define pb emplace_back
#define mp make_pair
#define snd second
#define fst first

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    
    int n; cin >> n;
    vi a(n);
    forn(i,n) cin >> a[i];
    sort(all(a));
    ll res = 0;
    forn(i,n) forsn(j,i+1,n){
        auto x = upper_bound(a.begin()+j+1,a.end(),a[j]-a[i]); 
        auto y = lower_bound(a.begin()+j+1,a.end(),a[j]+a[i]); 
        if(x < y) res += distance(x,y);
    }
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<map>
#include<set>
#include<vector>
#include<cstring>
#include<cassert>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<queue>	
#include<limits>
#include<ctime>
#include<stack>	
#include<bits/stdc++.h>
#include<string>
#include<stdlib.h>
#include<stdio.h>
	
typedef long long ll;
using namespace std;
const ll x=1000000007;
int mod(ll a){
	return a%x;
}

int main() {
	ll a,b;
	cin>>a>>b;
	ll i=1,ans=0;
	while(i<=9){
		int j=0;
		while(j<=9){
			int k=0;
			while(k<=9){
				if(10001*i+1010*j+100*k<=b and(10001*i+1010*j+100*k>=a)){
					ans++;
				}
				k++;
			}
			j++;
		}i++;
	}
	cout<<ans;
}


Measured memory_bytes: 3628
//↓template↓

#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 = 1e18;
const ll MOD = 1e9 + 7;
const double EPS = 1e-10;
const double pi = acos(-1);//3.1415926535897932384626433832795028...
const ll SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
ll fac[200005], finv[200005], inv[200005];
vector<ll>dij;
struct edge { ll to, cost; };
vector<vector<edge> >G;

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


//↑template↑


ll digits(ll n) {
	ll ans = 0;
	while (n) {
		ans += n % 10;
		n /= 10;
	}
	return ans;
}



int main() {
	ll a, b, c, ans = 0;
	cin >> a >> b >> c;


	for (int i = 1; i <= 72; ++i) {
		ll mon = pow(i + a, b);
		if (digits(mon) == i && mon > 0 && mon <= c) { ++ans; }
	}

	cout << ans << endl;
}


Measured memory_bytes: 3320
import bisect
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = sorted(H)

cannot = bisect.bisect_left(H, K)
print(N-cannot)


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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
ll n;
ll i, j, k;

int main(){
    
    scanf("%lld", &n);
    while(n){
        //printf("a");
        ll ans1,ans2;
        fornum(i,1,50000){
            ll nn = n - (i*(i+1)) / 2;
            if(nn<0||nn%i)
                continue;
            ans1 = nn / i+1;
            ans2 = i;
        }
        printf("%lld %lld\n", ans1,ans2);
        scanf("%lld", &n);
    }
    return 0;
}


Measured memory_bytes: 3192
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repl(i,n) for(int64_t i=0;i<(int64_t)(n);i++)
#define MAX_N 10000000
#define ll int64_t
#define all(v) (v).begin(),(v).end()
#define P pair<int,int>
using namespace std;

int main() {
    int n; cin>>n;
    vector<P> a(n);
    rep(i,n) cin>>a[i].second>>a[i].first;
    sort(all(a));
    ll t=0;
    rep(i,n) {
        t+=a[i].second;
        if(t>a[i].first) {
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
} 

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

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

  long long n, ans=0;
  cin >> n;
  vector<ll> b(n, 1e9);
  for(int i=0;i<n-1;i++){
    cin >> b[i];
  }
  ans+=b[0];
  for(int i=1;i<n;i++){
    ans+=min(b[i-1], b[i]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; --i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define repc2(i, s, n) for (int i = (s); i <= (int)(n); i++)
// #define inf 2e9
#define linf 9000000000000000000ll
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

#define N 200009
int n;
vector<pair<ll, ll>> v;
vector<ll> vx, vy;
ll f1(ll x, ll y) {
    return x - y;
}
ll f2(ll x, ll y) {
    return x + y;
}

int main() {
    cin >> n;
    v.resize(n);
    vx.resize(n);
    vy.resize(n);
    rep(i, n) {
        scanf("%lld%lld", &v[i].first, &v[i].second);
        vx[i] = v[i].first - v[i].second;
        vy[i] = v[i].first + v[i].second;
    }
    ll ans = 0;
    ll vxmax = *max_element(all(vx));
    ll vymax = *max_element(all(vy));
    ll vxmin = *min_element(all(vx));
    ll vymin = *min_element(all(vy));
    reps(i, n) {
        ans = max(ans, vxmax - vxmin);
        ans = max(ans, vymax - vymin);
    }

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

Measured memory_bytes: 9564
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>

#include <map>
using namespace std ;

typedef long long ll ;
#define rep (i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

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

	int N;
	string s;
	
	cin >> N >> s;

	int a = 0;
	int max = 0;
	map<char, int> m;
	/*
	for (int i = 1; i < s.size() - 1; i++)
	{
		int tmp = 0;
		for (int j = 0; j < i; j++)
		{
			a |= (1 << (s[j] - 'a'));
		}

		for (int j = i; j < s.size(); j++)
		{
			if ( ((1 << (s[j] - 'a')) & a) == 1)
			{
				tmp++;
				a &= ~(1 << (s[j] - 'a'));
			}
		}

		if (tmp > max)
		{
			max = tmp;
		}
	}
	*/

	for (int i = 1; i < s.size() - 1; i++)
	{
		int tmp = 0;
		for (int j = 0; j < i; j++)
		{
			if (m.find(s[j]) == m.end())
			{
				m.insert(make_pair(s[j], 0));
			}
		}
		for (int j = i; j < s.size(); j++)
		{
			map<char, int>::iterator it = m.find(s[j]);
			if (it != m.end())
			{
				tmp++;
				m.erase(it);
			}
		}

		if (tmp > max)
		{
			max = tmp;
		}
	}

	cout << max << endl;

	
	return 0;
}

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

int main(){

    int n;
    cin >> n;
    map<int,int> a;
    vector<int> b(n);
    ll c=0L;
    rep(i,n){
        cin >> b[i];
        a[b[i]]++;
        c += (a[b[i]]-1);
    }

    for(int i=0;i<n;i++){
        cout << c-(a[b[i]]-1) << endl;
    }

    return 0;
}

Measured memory_bytes: 8320
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>

using namespace std;

string s;

int main()
{

    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    cin>> s;
    int sum=0;
    for(int i=0;i<s.length();i++)   {
        sum += s[i]-48;
    }
    if(!(sum%9)){ cout<< "Yes" << endl; }
    else{ cout<< "No" << endl; }

    return 0;
}


Measured memory_bytes: 3716
import java.util.Scanner;
public class Main{
	Scanner sc = new Scanner(System.in);
	int pm,pe,pj;
	double avg1,avg2;
	int nin;
	public void sei(){
		nin = sc.nextInt();
		while(!(nin==0)){
		for(int i = 1;i<=nin;i++){
			pm = sc.nextInt();
			pe = sc.nextInt();
			pj = sc.nextInt();
			if((pm==100)||(pe==100)||(pj==100)){
				System.out.println("A");
			}else{
				avg1 = (pm +pe) / 2;
				if(avg1>=90){
					System.out.println("A");
					}else{
						avg2 = (pm + pe + pj) / 3;
						if(avg2>=80){
							System.out.println("A");
						}else{
							if(avg2>=70){
								System.out.println("B");
							}else{
								if(avg2>=50){
									if((pm>=80)||(pe>=80)){
										System.out.println("B");
									}else{
										System.out.println("C");
									}
								}else{
									System.out.println("C");
								}
							}
						}

				}

			}


		}
		nin = sc.nextInt();
		}
	}
	public static void main(String [] args){
		Main a= new Main();
		a.sei();
	}

}

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

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

typedef pair<int,int> ii;
string s;

int main(){
  getline(cin,s);
  deque<ii> ans;
  deque<int> deq;
  rep(i,s.size()){
    if( s[i] == '\\' ) deq.push_back(i);
    else if( s[i] == '/' && !deq.empty() ){
      int sp = deq.back(); deq.pop_back();
      int area = i - sp;
      while( !ans.empty() && sp <= ans.back().first ){
	area += ans.back().second;
	ans.pop_back();
      }
      ans.push_back(ii(sp,area));
    }
  }
  int sum = 0;
  rep(i,ans.size()) sum += ans[i].second;
  cout << sum << endl << (int)ans.size();
  rep(i,ans.size())cout << ' ' << ans[i].second; puts("");
  return 0;
}

Measured memory_bytes: 1304
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    void solve() throws IOException {
        int n = ni();
        out.println(n < 1200 ? "ABC" : "ARC");
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}

Measured memory_bytes: 8148
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  int h, w;
  readf("%s %s\n", &h, &w);
  auto m = new char[][](h, w);
  auto cnt = new int[][](h, w);
  foreach (i; 0..h) {
    m[i] = readln.chomp.to!(char[]);
    foreach (j; 0..w) {
      if (m[i][j] == '#') {
        cnt[i][j] = -1;
        foreach (x; i-1..i+2) {
          foreach (y; j-1..j+2) {
            if (x < 0 || x >= h) continue;
            if (y < 0 || y >= w) continue;
            if (cnt[x][y] == -1) continue;
            cnt[x][y]++;
          }
        }
      }
    }
  }

  foreach (i; 0..h) {
    foreach (j; 0..w) {
      if (cnt[i][j] == -1) write("#");
      else write(cnt[i][j]);
    }
    writeln("");
  }
}


Measured memory_bytes: 256
n,a,b = map(int,input().split())
V = list(map(int,input().split()))

V.sort(reverse = True)
s = 0
m = V[a-1]
ans = sum(V[:a])/a
print(ans)
cnt = V.count(m)
left = V.index(m)
ans = 0
memo = {}
def combi(m,k):
    if m*100+k in memo:
        return memo[m*100+k]
    elif k == 0:
        return 1
    else:
        memo[m*100+k] = combi(m,k-1)*(m-k+1)//k
        return memo[m*100+k]

if left == 0:
    for i in range(a,min(b,cnt)+1):
        ans += combi(cnt,i)
else:
    ans += combi(cnt,a-left)
    # if (sum(V[:a])/a).is_integer():
    #     ans *= pow(2,V.count(int(V[:a]/a)))
print(ans)


Measured memory_bytes: 3064
#include<stdio.h>
 char sa[1001];
int main(void){
    int a=0,b=0,i;
    while(1){
      for(i=0;i<1001;i++){
        scanf("%c",&sa[i]);
          if(sa[0]=='0'||sa[i]=='\n')break;
        a=sa[i]-'0';
        b=b+a;
      }
      if(sa[0]=='0')break;
      printf("%d\n",b);
      b=0;
    }
return 0;
}

Measured memory_bytes: 536
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <string.h>
#include <stack>
#include <list>
#include <vector>

using namespace std;
char s[1001];
int main(){
  cin >> s;
  int i=0;
  while(s[i] != '\0'){
    int c = s[i] - 'A';
    c = c-3;
    c = c < 0 ? c+26 : c;
    printf("%c", 'A'+c);
    i++;
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 1128
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;


int main(){
    ll N, A, B;
    cin >> N >> A >> B;

    cout << min(B, N * A) << endl;
    
    return 0;
}

Measured memory_bytes: 3556
// Author : MohamedSameh
#include <bits/stdc++.h>
typedef long long ll ;
#define pb push_back
#define f first
#define s second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SZ(a) (int)a.size()
void fo (){fflush(stdout);}
using namespace std;

int main ()
{
  int n ;
  cin >> n ;
  cout << 24 + (24 - n) <<"\n";

  cerr << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<map>
#include<set>
#include<vector>
using namespace std;
typedef long long ll;
int main()
{
    string x;
    ll n;
    cin>>n;
    cin>>x;
    if(n%2!=0)
    {
        printf("No");
        return 0;
    }
    else
    {

        ll j=n/2,flag=1;
        for(ll i=0; i<n/2; i++,j++)
        {
            if(x[i]!=x[j])
            {
                flag=0;
                break;
            }
        }
        if(flag)
            printf("Yes");
        else
            printf("No");
    }
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
int main(){
    long long r, c;
    cin >> r >> c;
    char board[r][c];
    int dp[r][c];
    for(int i = 0;i < r;++i){
        for(int j = 0;j < c;++j)
            cin >> board[i][j];
    }
    memset(dp, 0, sizeof(dp));
    for(int i = 0;i < c;++i){
        if(board[0][i] == '#') break;
        else dp[0][i] = 1;
    }
    for(int i = 0;i < r;++i){
        if(board[i][0] == '#') break;
        else dp[i][0] = 1;
    }
    for(int i = 1;i < r;++i){
        for(int j = 1;j < c;++j){
            if(board[i][j] != '#') dp[i][j] = (dp[i - 1][j] % mod + dp[i][j - 1] % mod) % mod;
        }
    }
    cout << dp[r - 1][c - 1] << endl;
    return 0;
}

Measured memory_bytes: 5120
#include <cstdio>

int main() {
  int n;
  scanf("%d",&n);
  int i;
  int a,b,c;
  for(i = 0; i < n; i++) {
    scanf("%d %d %d\n", &a, &b, &c);
    int aa, bb, cc;
    aa = a*a;
    bb = b*b;
    cc = c*c;
    if(aa == bb+cc | bb == aa+cc | cc == aa+bb) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}

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

void count(double input, int* rank) {
    if (input >= 1.1) {
        rank[0]++;
    } else if (input >= 0.6) {
        rank[1]++;
    } else if (input >= 0.2) {
        rank[2]++;
    } else {
        rank[3]++;
    }
}

int main() {
    int leftEyesight[4] = {}, rightEyesight[4] = {};
    double left, right;
    while (cin >> left >> right) {
        count(left, leftEyesight);
        count(right, rightEyesight);
    }
    for (int i = 0; i < 4; i++) {
        cout << leftEyesight[i] << " " << rightEyesight[i] << endl;
    }
}

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

ll perm(ll n)
{
    return n == 1? 1 : (n*perm(n-1)) % (1000000007);
}

int main(void)
{
    ll n,m;
    cin >> n >> m;

    if (abs(n-m) == 0)
    {
        cout << (perm(n) * perm(n) * 2)% (1000000007) << endl;
    }
    else if (abs(n-m) == 1)
    {
        cout << (perm(n) * perm(m))% (1000000007) << endl;
    }
    else
    {
        cout << 0 << endl;
    }
    
    return 0;
}


Measured memory_bytes: 1792
n=int(input())
a=[0 for i in range(n+1)]
for i in range(n+1): #0,1,2,3,…n-1,n+1-1:nが3でも5でも割り切れない場合range(n)ではダメ
    if i%3!=0 and i%5!=0:
        a[i]=int(i)

print(sum(a))


Measured memory_bytes: 33892
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	int x;
	int sum;
	int i;
	int cnt;
	cin>>n;
	sum=0;
	for(i=1;i<=n;i++){
		x=i;
		cnt=0;
		while(x>0){
			x/=10;
			cnt++;
		}
		if(cnt%2!=0)	sum++;
	}
	cout<<sum<<endl;
	return 0;
}

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

using namespace std;

int main()
{
    string s = "CODEFESTIVAL2016";
    string str;
    cin >> str;

    int cnt = 0;

    for (int i = 0; i < 16; i++) {
        if (s[i] != str[i]) cnt++;
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//#include <stdbool.h>
//#include <limits.h>
//#include <math.h>

int main() {
  int n, m ,x;
  scanf("%d%d%d", &n, &m, &x);
  int a[m], left = 0;
  for (int i=0; i<m; i++) {
    scanf("%d", a+i);
    if (x>a[i]) left++;
  }
  if (left < m-left) printf("%d\n", left);
  else printf("%d\n", m-left);
  return 0;
}


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

using namespace std;
int main() {
    int n;
    int q;
    int cnt = 0;

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

    cin >> q;
    vector<int> T(q);
    for (int i = 0; i < q; i++) {
        cin >> T[i];
    }

    for (int i = 0; i < q; i++) {
        int left = 0;
        int right = n;
        while (left < right) {
            int med = (left + right)/2;
            if (T[i] == S[med]) {
                cnt++;
                break;
            } else if (T[i] < S[med]) {
                right = med;
            } else {
                left = med + 1;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}




Measured memory_bytes: 3252
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)
function main()
    n,k=parseMap(split(readline()))
    p=parseMap(split(readline()))
    res=sum(Vector(p[1:k]))
    m=res
    for i in k+1:n
        res+=p[i]-p[i-k]
        m=max(res,m)
    end
    println((k+m)/2)
end
main()

Measured memory_bytes: 124808
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>

//#include<bits/stdc++.h>


using namespace std;




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: 256