akhauriyash/Code-Regression huggingface dataset:
import Control.Applicative
import Control.Monad
import Control.Monad.ST
-- import qualified Data.ByteString as BS
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import qualified Data.Set as Set
--import qualified Data.Sequence as Sequence
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
import Data.Array
--import Data.Array.Unboxed
--import Data.Array.IArray
import Data.Array.MArray
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
import GHC.ST
-- import System.IO.Unsafe
 
-- templete
readInt = read :: String -> Int
readInteger = read :: String -> Integer
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getInteger = readLn :: IO Integer
getIntegers = map readInteger . words <$> getLine
getDouble = readLn :: IO Double
getDoubles = map readDouble . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
tjoin :: (Show a, Show b) => (a, b) -> String
tjoin (x, y) = show x ++ (' ' : show y)
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
apply4 :: (a -> a -> a -> a -> b) -> [a] -> b
apply4 f [x,y,z,w] = f x y z w
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
binMap :: (a -> a -> b) -> [a] -> [b]
binMap f (x:xs@(y:_)) = f x y : binMap f xs
binMap _ _ = []
splitRec :: Int -> [a] -> [[a]]
splitRec _ [] = []
splitRec n xs = let (y,ys) = splitAt n xs in y : splitRec n ys
infixl 7 `divCeil`
divCeil :: Integral a => a -> a -> a
x `divCeil` y = (x+y-1) `div` y
coverC :: Ord a => (a, a) -> a -> Bool
coverC (l,r) x = l<=x && x<=r
coverH :: Ord a => (a, a) -> a -> Bool
coverH (l,r) x = l<=x && x<r
ibsearch :: (Int -> Bool) -> (Int,Int) -> Int
ibsearch f (ok,ng) = if abs (ok-ng) <= 1 then ok else let mid = (ok + ng) `div` 2 in ibsearch f (if f mid then (mid,ng) else (ok,mid))
whenM :: Monad m => m Bool -> m () -> m ()
whenM c a = c >>= flip when a
-- templete

f w h c = let t = replicate (div (h-3) 2) i in [b] ++ t ++ [x] ++ t ++ [b]
  where
    b = "+" ++ replicate (w-2) '-' ++ "+"
    i = "|" ++ replicate (w-2) '.' ++ "|"
    x = let t = replicate (div (w-3) 2) '.' in "|" ++ t ++ [c] ++ t ++ "|"

main = words <$> getLine >>= mapM_ putStrLn . (\[h,w,c] -> f (readInt h) (readInt w) (head c))


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

#define ll long long
#define INF 99999999
#define rep(i,n) for(int i=0,temp=(int)(n);i<temp;++i) 
#define repi(i,start,end) for(int i=start,temp=(int)(end);i<end;++i)
#define rfor(v,x) for(const auto& x : v) //xは値を表す
#define all(x) (x).begin(),(x).end()
#define SORT(v, n) sort(v, v+n)
#define vsort(v) sort(v.begin(), v.end())
#define vfsort(v,lambda) sort(v.begin(),v.end(),lambda)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vin(v) rep(i,v.size()) {cin >> v[i];}
//最終奥義
#define int long long
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 (b<a) { a=b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int ctoi(char c) {return c-'0';}
//(lambda (x y) (< x y)) => [](int x, int y) -> int { return x<y; }
int lcm(ll a,ll b){return a*b/gcd(a,b);}

signed main(void){
  ll a,b,c,d,e;
  cin >> a >> b >> c >> d;
  ll ans = b-a+1;
  e=lcm(c,d);
  ans -= b/c + b/d + (a-1)/e;
  ans += (a-1)/c + (a-1)/d + b/e;
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=0;
    char s[27];
    cin>>s;
    for(int i=0;i<strlen(s);i++){
        for(int j=0;j<strlen(s);j++){
            if(j==i)
             continue;
            else if(s[j]==s[i])
             {t++;break;}
        }
    }
    if(t>0)
     cout<<"no";
    else 
     cout<<"yes";
    return 0;
}
     
   




Measured memory_bytes: 3660
unittest
{
	assert( [ "3 3", "2 13 8" ].parse.expand.solve == 9 );
	assert( [ "4 4", "1 9 3 5" ].parse.expand.solve == 6 );
	assert( [ "1 100000", "1000000000" ].parse.expand.solve == 0 );
	assert( [ "10 1", "1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000" ].parse.expand.solve == 9500000000 );
}



import std.algorithm;
import std.conv;
import std.container;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nm = input.front.split.to!( long[] );
	input.popFront;
	auto as = input.front.split.to!( long[] );
	return tuple( nm[ 1 ], as );
}

auto solve( long m, long[] as )
{
	auto queue = heapify( as );
	for( ; 0 < m; m-- )
	{
		queue.replaceFront( queue.front >> 1 );
	}
	return as.sum;
}


Measured memory_bytes: 6472
N,B,R = map(int,input().split())
k = N % (B + R)
k2 = int(N / (B + R))
#s = ("b"*B + "r"*R)

#s1 = s[:k]
if k <= B:
	print(k2*(B) + k)
else:
	print(k2*(B) + B)

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

using namespace std;

int main() {
  string s,t;
  cin>>s>>t;
  int a=s.size();
  int ans=0;
  for(int i=0;i<a;i++){
    if(s.at(i)!=t.at(i)){
      ans++;
    }
  }
  cout<<ans<<endl;
  
  
}

Measured memory_bytes: 3912
#include <iostream>
#include <math.h>
#include <vector>
#include <iomanip>
#include <algorithm>

int adjust(int x) {

    if (x % 10 != 0) {
        return ((x / 10) + 1) * 10;
    } else {
        return x;
    }

}

int main() {


    int A, B, C, D, E;
    std::cin >> A >> B >> C >> D >> E;

    std::vector<int> as = {A, B, C, D, E};
    std::vector<int> p = {0, 1, 2, 3, 4};

    int result = (123 + 7) * 5;

    do {

        int ans = 0;

        for (int i = 0; i < 4; i++) {
            ans += adjust(as[p[i]]);
        }

        ans += as[p[4]];

        result = std::min(result, ans);

    } while (std::next_permutation(p.begin(), p.end()));

    std::cout << result << "\n";

    return 0;
}


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

int main(){
    int h,w;
    while(1){
        cin>>h>>w;
        if(h==0&&w==0)break;
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                if((i+j)%2==0)cout<<"#";
                else cout<<".";
            }cout<<endl;
        }cout<<endl;
    }return 0;
}


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

using namespace std;

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;

constexpr int MAXW = 100000;

ll dp[MAXW + 2];

int main() {
	int N, W;
	cin >> N >> W;
	for(int i = 0; i < N; i++) {
		int w, v;
		cin >> w >> v;
		for(int j = W; j >= w; j--)
			dp[j] = max(dp[j], dp[j - w] + v);
	}
	cout << dp[W] << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long; // ll は long long　と同じとする。(int64_t)
int main(){
    int a , b;
    cin >> a >> b;
    int t = a + b;
    if(t % 2 == 0){
        cout << t / 2 << endl;
    }
    else{
        cout << t / 2 + 1 << endl;
    }
}

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

typedef long long ll;

int main(){

    int n;
    cin >> n;

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

    ll m = 0;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            m = max(m, abs(v[i]-v[j]));
        }
    }
    cout << m << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int h, w;
char A[110][110];

int main()
{
    scanf("%d %d", &h, &w);

    for(int i=0; i<h; i++)
        scanf("%s", &A[i]);

    for(int i=0; i<h; i++)
        for(int j=0; j<2; j++)
            printf("%s\n", A[i]);


    return 0;

}


Measured memory_bytes: 128
//package atcoder.beginner144;

import java.io.*;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
//        try {
//            FastScanner in = new FastScanner(new FileInputStream("src/input.in"));
//            PrintWriter out = new PrintWriter(new FileOutputStream("src/output.out"));
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        long n = in.nextLong();
        long res = Long.MAX_VALUE;
        for(long i = 1; i * i <= n; i++) {
            if(n % i == 0) {
                res = Math.min(res, i + n / i);
            }
        }
        out.println(res - 2);
        out.close();

//        }
//        catch (IOException e) {
//            e.printStackTrace();
//        }
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream stream) {
            try {
                br = new BufferedReader(new InputStreamReader(stream));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}




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

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

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

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//use std::char;

fn main() {
    input!{
        n: usize,
        k: usize,
    }
    let mut i = 0;
    loop {
        if n < k.pow(i+1) {
            println!("{}", i+1);
            break;
        }
        i = i + 1;
    }

}


Measured memory_bytes: 4352
H, W = [int(i) for i in input().split()]
s = [list(input()) for _ in range(H)]

s.append(['.']*W)
s.insert(0, ['.']*W)
for i in range(H+2):
  s[i].append('.')
  s[i].insert(0, '.')


ans='Yes'
for i in range(1,H+1):
  for j in range(1,W+1):
    if s[i][j] == '.':
      continue
    if s[i-1][j] == '#' or s[i+1][j] == '#' or s[i][j-1] == '#' or s[i][j+1] == '#':
      continue
    else:
      ans='No'
      break

print(ans)


Measured memory_bytes: 3064
list_n = input()
lis = [i for i in list_n]
hon = [2,4,5,7,9]
pon = [0,1,6,8]
bon = [3]
if int(lis[-1]) in hon:
    print("hon")
elif int(lis[-1]) in pon:
    print("pon")
else:
    print("bon")

Measured memory_bytes: 9056
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

int main() {
	int W, N, count = 0;

	while(cin >> W, W) {
		count++;
		cin >> N;
		vvi data(N, vi(2));
		char c;
		REP(i, N) {
			cin >> data[i][0] >> c >> data[i][1];
		}

		vvi dp(N+1, vi(W+1));
		REP(j, W+1) {
			dp[0][j] = 0;
		}

		REP(i, N) {
			FOR(j, 0, W) {
				if(j < data[i][1]) {
					dp[i+1][j] = dp[i][j];
				} else {
					dp[i+1][j] = max(dp[i][j], dp[i][j-data[i][1]]+data[i][0]);
				}
			}
		}

		int ans_w = 0, ans_j;
		FOR(j, 0, W) {
			if(ans_w < dp[N][j]) {
				ans_w = dp[N][j];
				ans_j = j;
			}
		}

		cout << "Case " << count << ":" << endl;
		cout << ans_w << endl;
		cout << ans_j << endl;
	}

	return 0;
}

Measured memory_bytes: 5032
#include<bits/stdc++.h>
#define int int64_t

using namespace std;

vector<int> adj[100001];
vector<int> val,vis;

int dfs(int u){
	vis[u] = 1;
	int ans=0;
	for(auto it : adj[u]){
		if(vis[it]) {
			ans = max(ans,1 + val[it]);
			continue;
		}
		ans = max(1+dfs(it),ans);
		
	}
	val[u] = ans;
	return val[u];
}
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n,m;
	cin>>n>>m;
	val.resize(n+1);
	vis.resize(n+1);
	for(int i=1;i<=n;i++) vis[i] = val[i] = 0;
	for(int i=0;i<m;i++){
		int u,v;
		cin>>u>>v;
		adj[u].push_back(v);
	}
	
	for(int i=1;i<=n;i++){
		if(!vis[i]) dfs(i);
	}
	int mx = INT_MIN;
	for(int i=1;i<=n;i++) mx = max(mx,val[i]);
	
	cout<< mx <<"\n";
}

Measured memory_bytes: 12336
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  if(a==b&&b==c&&c==a)cout<<"1"<<endl;
  else if(a!=b&&b!=c&&c!=a)cout<<"3"<<endl;
  else cout<<"2"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int MOD = 1000000007;

int modpow(ll a, ll ex, ll p){
    if (ex == 1) return a % p;
    if (ex % 2 == 1) return a * modpow(a, ex - 1, p) % p;
    ll t = modpow(a, ex / 2, p);
    return t * t % p;
}

int main(void){
    int m, n; cin >> m >> n;
    cout << modpow(m, n, MOD) << endl;
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MOD 1000000007
#define PI 3.141592653589793

int main(){
    int n;
    cin >> n;
    unordered_map<string, int> m;
    while(n--){
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        m[s]++;
    }
    ll ans = 0;
    for(auto p: m){
        ll x = (ll)p.second;
        ans += x*(x-1)/2;  // nC2
    }
    cout << ans << endl;
}


Measured memory_bytes: 10660
#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << x << endl
#define debugArray(x, n)                           \
  cerr << __LINE__ << ": " << #x << " = {";        \
  for (long long hoge = 0; (hoge) < (n); ++(hoge)) \
    cerr << ((hoge) ? "," : "") << x[hoge];        \
  cerr << "}" << endl
#else
#define debug(x) (void(0))
#define debugArray(x, n) (void(0))
#endif

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  long double x[N], y[N];
  for (int i = 0; i < N; i++) cin >> x[i] >> y[i];
  vector<int> p(N);
  iota(p.begin(), p.end(), 0);
  int cnt = 1;
  for (int i = 1; i <= N; i++) cnt *= i;
  long double ans = 0;
  for (int j = 0; j < cnt; j++) {
    long double dist = 0;
    for (int i = 0; i + 1 < N; i++) {
      long double dx = x[p[i + 1]] - x[p[i]];
      long double dy = y[p[i + 1]] - y[p[i]];
      dist += sqrt(dx * dx + dy * dy);
    }
    ans += dist;
    next_permutation(p.begin(), p.end());
  }
  ans /= cnt;
  cout << fixed << setprecision(12) << ans << '\n';
  return 0;
}


Measured memory_bytes: 3836
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bits/stdc++.h>
#include<queue>
#include <numeric>
#include<stdio.h>
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();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//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 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,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 

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

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

int main(){
    string S;
    cin >> S;
    int L=S.length();
    sort(S.begin(),S.end());
    bool exist=false;
    char ans='1';
    for(char i='a';i<='z';++i){
        exist=false;
        for(int j=0;j<L;++j){
            if(S[j]==i){
                exist=true;
                break;
            }
        }
        if(exist==false){
            ans=i;
            break;
        }
    }
    if(ans=='1'){
        cout << "None";
    }
    else{
        cout << ans ;
    }
    }

Measured memory_bytes: 512
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
//#pragma warning(disable : 4996)

#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>
#include<array>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), (n))
#define ub(v,n) upper_bound(v.begin(), v.end(), (n))
#define int long long
//#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>pii;
typedef array<int, 3> arr3;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 1e9 + 7; constexpr int MAX = 2000020;
const double pi = acos(-1); constexpr double EPS = 1e-8;
constexpr ll INF = 1e18;
void yes(bool c) { if (c)print("Yes"); else print("No"); };


void solve() {
	int K; cin >> K;
	int A, B; cin >> A >> B;
	FOR(i, A, B + 1) {
		if (i%K == 0) {
			print("OK"); return;
		}
	}
	print("NG");
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q; cin >> q;
	//while (q--)
		solve();
}



Measured memory_bytes: 3660
#include <iostream>

using namespace std;

int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if(a<=b){
        if(b>=c){
            cout<<a+c<<endl;
        }else{
            cout<<a+b<<endl;
        }
    }else if(a>=b){
        if (a>=c) {
            cout<<b+c<<endl;
        }else{
            cout<<a+b<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#define ll				long long
#define MOD				1000000007
#define VTX_MAX			10000
#define EDGE_MAX		10000

#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

typedef struct Edge {
	int vno;
	struct Edge *next;
} Edge;

typedef struct Vtx {
	Edge *edge;
	int val;
} Vtx;

Vtx vtxs[VTX_MAX];
int vcnt;
Edge edges[EDGE_MAX * 2];
int ecnt;

int vals[VTX_MAX];
int no;

FILE *in, *ans;
int tno;

int out(const char *s) {
#ifdef TEST
	char buf[8192];
	fgets(buf, sizeof(buf), ans);
	if (strcmp(buf, s)) {
		printf("err\n");
	}
#else
	printf(s);
#endif
	return 0;
}

int addedge(int vfno, int vtno) {

	edges[ecnt].vno = vtno;
	edges[ecnt].next = vtxs[vfno].edge;
	vtxs[vfno].edge = &edges[ecnt];
	ecnt++;

	return 0;
}

int outi(int i) {
	char s[128];
	sprintf(s, "%d\n", i);
	out(s);
	return 0;
}

int outd(double d) {
	char s[128];
	sprintf(s, "%.10lf\n", d);
	out(s);
	return 0;
}

int outll(ll l) {
	char s[128];
	sprintf(s, "%lld\n", l);
	out(s);
	return 0;
}

int geti() {
	int i;
	fscanf(in, "%d", &i);
	return i;
}

ll getll() {
	ll l;
	fscanf(in, "%lld", &l);
	return l;
}

int getstr(char *s) {
	fscanf(in, "%s", s);
	return 0;
}

int sortfnci(const void *v1, const void *v2) {
	int *i1 = (int *)v1;
	int *i2 = (int *)v2;

	if (*i1 > *i2) {
		return -1;
	}
	else if (*i1 < *i2) {
		return 1;
	}

	return 0;
}

int setval(int vno) {

	if (vtxs[vno].val > 0) {
		return 0;
	}
	vtxs[vno].val = vals[no];
	no++;

	Edge *edge = vtxs[vno].edge;
	while (edge != NULL) {
		setval(edge->vno);
		edge = edge->next;
	}

	return 0;
}

int fnc() {
	int i, j, k;

	memset(vtxs, 0, sizeof(vtxs));
	ecnt = 0;

	vcnt = geti();

	for (i = 0; i < vcnt - 1; i++) {
		int vno1 = geti() - 1;
		int vno2 = geti() - 1;
		addedge(vno1, vno2);
		addedge(vno2, vno1);
	}

	no = 0;
	for (i = 0; i < vcnt; i++) {
		vals[i] = geti();
	}
	qsort(vals, vcnt, sizeof(int), sortfnci);

	setval(0);

	int sum = 0;
	for (i = 0; i < vcnt; i++) {
		Edge *edge = vtxs[i].edge;
		while (edge != NULL) {
			if (vtxs[i].val < vtxs[edge->vno].val) {
				sum += vtxs[i].val;
			}
			else {
				sum += vtxs[edge->vno].val;
			}
			edge = edge->next;
		}
	}

	outi(sum / 2);
	printf("%d", vtxs[0].val);
	for (i = 1; i < vcnt; i++) {
		printf(" %d", vtxs[i].val);
	}
	printf("\n");

	return 0;
}

int main() {

#ifdef TEST
	for (tno = TEST_SNO; tno <= TEST_ENO; tno++) {
		char str[128];
		sprintf(str, "test%d.txt", tno);
		in = fopen(str, "r");
		sprintf(str, "ans%d.txt", tno);
		ans = fopen(str, "r");
		fnc();
		fclose(in);
		fclose(ans);
	}
	printf("end\n");
#else
	in = stdin;
	fnc();
#endif

	return 0;
}


Measured memory_bytes: 1020
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repd(i, n) for (int i = n; i >= 1; i--)
#define mod 1000000007
#define MOD 998244353
#define inf 1e20
typedef long long int ll;
typedef pair<ll, ll> p;


int main() {
	string s;
	cin >> s;
	int ans = 700;
	rep(i, 3) {
		if (s[i] ==* "o") {
			ans += 100;
		}
	}
	cout << ans << endl;
	return 0;
}

//Ctrl+Aを使わない

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb           push_back
#define pf           push_front
#define in           insert
#define ff           first
#define ss           second
#define mp           make_pair
#define int          long long
#define uint         unsigned long long
#define rep(i,x,m)   for(int i=x;i<m;i++)
#define repr(i,x,m)  for(int i=x;i>=m;i--)
#define MOD          1000000007
#define endl         "\n"
#define all(v)       v.begin(),v.end()
#define rall(v)      v.rbegin(),v.rend()
#define vi           vector<int>
#define vs           vector<string>
#define pi           pair<int,int>
#define di           deque<int>
#define sz(x)       (int)x.size()
#define pq           priority_queue<int>
#define pqs          priority_queue<int,vi,greater<int> >
#define fix(y)       fixed<<setprecision(y)
#define print(v)     for(int i=0;i<v.size();i++) cout<<v[i]<<" ";cout<<endl
#define noob         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

int fac[2000005]={0};
void factorial(){ fac[0]=1; fac[1]=1; for(int i=2;i<200005;i++) fac[i]=((i%MOD)*(fac[i-1]%MOD))%MOD;}
int power(int n,int m)
{int p=1;if(m==0)return 1;p=(power(n,m/2)%MOD);p=(p%MOD*p%MOD)%MOD;
return(m&1?((p%MOD*n%MOD)%MOD):(p%MOD));}
int ncr(int n,int r){return ((fac[n]*power(fac[r],MOD-2))%MOD*power(fac[n-r],MOD-2))%MOD;}

void ram5564()
{
    int n;
    cin>>n;
    int cnt=0;
    rep(i,1,n+1)
    {
        int x;
        cin>>x;
        if(x&1)
        {
            if(i&1)
                ++cnt;
        }
    }
    cout<<cnt;
}

signed main()
{
        noob
        // #ifndef ONLINE_JUDGE
        //  freopen("input.txt","r",stdin);
        //  freopen("output.txt","w",stdout);
        //  #endif   
        
        int t=1;
        //cin>>t;
        while(t--)
        ram5564();
        return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char C;
  char NC;
  cin >> C;
  
  string Alphabet = "abcdefghijklmnopqrstuvwxyz";
  
  for(int i=0;i<25;i++){
    if ( Alphabet.at(i) == C ){
      cout << Alphabet.at(i+1) << endl;
      break;
    }
  }
  
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main(){
    string s, t; cin >> s >> t;
    int n = s.size();
    int cnt = 0;
    rep(i, n){
        if(s[i] != t[i]) cnt++;
    }
    cout << cnt << endl;    
	return;
}

int main(){
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}

Measured memory_bytes: 3840
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ll long long
#define MOD 1000000007
#define MAX 1000010
using namespace std;


int main(){
  int a,b;
  cin>>a>>b;
  
  if(a>b){
    REP(i,a) cout << b;
  }
  else{
    REP(i,b) cout << a;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
	int n,a;
	cin>>n;
	double ans=0;
	for(int i=0;i<n;i++){
		cin>>a;
		ans+=1.0/a;
	}
	cout<<setprecision(10)<<1.0/ans<<endl;
	return 0;
}

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

int root(int a,int P[])
{
    if(P[a] == a)
        return a;
    else    return (P[a] = root(P[a],P));
}
int is_same_set(int a,int b,int P[])
{
    return root(a,P) == root(b,P);
}

int main()
{
    int n,i,j,M=0,minsum=0;
    cin >> n;
    //init(n);
    int a[n][n],cost[n*n],src[n*n],dst[n*n];
    for(i=0;i<n;i++)
        for(j=0;j<n;j++)
            cin >> a[i][j];
    for(int r=0;r<n;r++)
        for(int c=r+1;c<n;c++)
            if(a[r][c] > -1)
            {
                cost[M] = a[r][c];
                src[M] = r;
                dst[M] = c;
                M++;
            }
    pair<int,int> edeges[M];
    int P[n];
    for(i=0;i<n;i++)
        P[i] = i;
    for(i=0;i<M;i++)
    {
        edeges[i].first = cost[i];
        edeges[i].second = i;
    }
    sort(edeges,edeges+M);
    for(i=0;i<M;i++)
    {
        if(is_same_set(src[edeges[i].second], dst[edeges[i].second], P))
            continue;
        else    {
                    P[root(src[edeges[i].second],P)] = root(dst[edeges[i].second],P);
                    minsum += edeges[i].first;
                }
    }
    cout << minsum << endl;
    return 0;
}



Measured memory_bytes: 3140
#include<iostream>
#include<vector>
#include<algorithm>
#include <string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>

using namespace std;


#define ok printf("ok\n");
#define MAX 1000000
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(g);(i)--)
#define all(a) (a).begin(),(a).end()
#define pb push_back

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
int main()
{
	int a=0,b,c;
	string s;
	cin >> s;
	c = s.size();
	rep(i,c)
		a+=(int(s[i])-'0');
	b = stod(s);
	if(b%a == 0)
		cout << "Yes";
	else
		cout << "No";
	return 0;
}

Measured memory_bytes: 256
n = gets.to_i

values = gets.chomp.split(" ").map(&:to_i)
costs = gets.chomp.split(" ").map(&:to_i)

xy = values.map.with_index{|v,i| v - costs[i]}

cost = [0]
1.upto(n) do |i|
  cost += xy.combination(i).collect{|arr| arr.inject(:+)}
end

puts cost.max

Measured memory_bytes: 77220
#include<stdio.h>
#include<math.h>
struct Point{ double x, y;};
void koch(int n,Point a,Point b){
    if(n==0)return;
Point s,t,u;
double th=M_PI * 60.0/180.0;
s.x=(2.0*a.x+1.0*b.x)/3.0;
s.y=(2.0*a.y+1.0*b.y)/3.0;
t.x=(1.0*a.x+2.0*b.x)/3.0;
t.y=(1.0*a.y+2.0*b.y)/3.0;
u.x=(t.x-s.x)*cos(th)-(t.y-s.y)*sin(th)+s.x;
u.y=(t.x-s.x)*sin(th)+(t.y-s.y)*cos(th)+s.y;
koch(n-1,a,s);
printf("%.8f %.8f\n",s.x,s.y);
koch(n-1,s,u);
printf("%.8f %.8f\n",u.x,u.y);
koch(n-1,u,t);
printf("%.8f %.8f\n",t.x,t.y);
koch(n-1,t,b);
}
int main(){
    Point a,b;
    int n;
    scanf("%d",&n);
    a.x=0;
    a.y=0;
    b.x=100;
    b.y=0;
    printf("%.8f %.8f\n",a.x,a.y);
    koch(n,a,b);
    printf("%.8f %.8f\n",b.x,b.y);
    return 0;
}


Measured memory_bytes: 2716
from collections import deque

n = int(input())
l = deque()

for i in range(n):
    commands = input()

    if commands == "deleteFirst":
        l.popleft()

    elif commands == "deleteLast":
        l.pop()

    else:
        command, x = commands.split()

        if command == "insert":
            l.appendleft(x)
            

        else:
            try:
                l.remove(x)
            except:
                pass

print(' '.join(l))


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

public static class Bits
{
    public static string ToBitStr(this int i)
    {
        return Convert.ToString(i, 2).PadLeft(12, '0');
    }
}
public class Key
{
    public long Cost;
    public int Targets;

    public Key(long cost, int[] targets)
    {
        Cost = cost;
        foreach (var t in targets)
        {
            Targets |= 1 << (t - 1);
        }
    }

    public Key(long cost, int targets)
    {
        Cost = cost;
        Targets = targets;
    }

    public bool Has(int index)
    {
        return (Targets & (1 << index)) != 0;
    }
    public Key Join(Key other)
    {
        return new Key(Cost + other.Cost, Targets | other.Targets);
    }

    public override string ToString()
    {
        return $"[Cost:{Cost} Targets:{Targets.ToBitStr()}]";
    }
}

public class Solution
{
    public static void Main()
    {
        var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var N = vals[0];
        var M = vals[1];
        var keys = new Key[M];
        for (int i = 0; i < M; i++)
        {
            vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var a = vals[0];
            var b = vals[1];
            var c = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            keys[i] = new Key(a, c);
        }

        var startKey = new Key(0, new int[0]);
        var curKeys = new Dictionary<int, Key>() { { 0, startKey } };
        for (int i = 0; i < N; i++)
        {
            var nextKeys = new Dictionary<int, Key>();
            var addKeys = keys.Where(k => k.Has(i)).ToList();
            foreach (var key in curKeys.Values)
            {
                if (key.Has(i))
                {
                    if (!nextKeys.ContainsKey(key.Targets) || nextKeys[key.Targets].Cost > key.Cost)
                    {
                        nextKeys[key.Targets] = key;
                    }
                }
                else
                {
                    foreach (var a in addKeys)
                    {
                        var nKey = key.Join(a);
                        if (!nextKeys.ContainsKey(nKey.Targets) || nextKeys[nKey.Targets].Cost > nKey.Cost)
                        {
                            nextKeys[nKey.Targets] = nKey;
                        }
                    }
                }
            }

            curKeys = nextKeys;
        }

        if (curKeys.Count == 0)
        {
            Console.WriteLine(-1);
            return;
        }

        var best = curKeys.Values.OrderBy(k => k.Cost).First();
        Console.WriteLine(best.Cost);
    }
}

Measured memory_bytes: 19928
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<cmath>
#include<cstdio>
#define rep(i,n) for(int i=0; i<(n); ++i)
using namespace std;
using ll =long long;
using P = pair<int,int>;

int main(){
    ll n;
    string sr;
    cin >> n >> sr;
    char aaa = sr[0];
    vector<char> ans(100000);
    ans[0]=sr[0];
    ll ct=1;
    for(ll i=1;i<n;i++){
        if(aaa!=sr[i]){
            ans[ct]=sr[i];
            ct++;
            aaa=sr[i];
        }
    }
    cout << ct << endl;
    return 0;
}

Measured memory_bytes: 512
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
	Scanner scan = new Scanner(System.in);
	int a = scan.nextInt();
	int b = scan.nextInt();
	
	if(a < b){
		System.out.println("a < b");
	}else if (a > b){
		System.out.println("a > b");
	}else{
		System.out.println("a == b");
		}
	}
}		


Measured memory_bytes: 26184
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ll long long
#define MOD 1000000007
#define MAX 1000010
using namespace std;

// a^n mod
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

// a^{-1} mod
ll modinv(ll a) {
    return modpow(a, MOD - 2);
}

vector<pair<ll, ll> > prime_factorize(ll n) {
    vector<pair<ll, ll> > res;
    for (ll p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

int main(){
  ll n;
  cin >> n;
  vector<ll> a(n);
  REP(i,n) cin >> a[i];
  vector<ll> max_index(MAX,0);
  
  REP(i,n){
    auto pf = prime_factorize(a[i]);
    for(auto p : pf) max_index[p.first] = max(max_index[p.first], p.second);
  }
  
  ll lcm = 1;
  REP(i,MAX){
    if(max_index[i] != 0){
      lcm *= modpow(i,max_index[i]);
      lcm %= MOD;
    }
  }
  
  ll ans = 0;
  REP(i,n){
    ans += lcm * modinv(a[i]) % MOD;
    ans %= MOD;
  }
  
  cout << ans % MOD;
  return 0;
}

Measured memory_bytes: 8192
#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>

using namespace std;

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

Measured memory_bytes: 256
n, q = gets.split().map(&:to_i)
s = gets.chomp

lr = []

q.times do 
  lr << gets.split().map(&:to_i)
end

array = [0]

(s.size-1).times do |i|
  if s[i..i+1] == "AC"
    array[i+1] = array[i] + 1
  else
    array[i+1] = array[i]
  end
end

lr.each do |l,r|
  puts array[r-1] - array[l-1]
end



Measured memory_bytes: 11204
//#include <boost/multiprecision/cpp_dec_float.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <algorithm>
#include <bitset>
#include <iomanip>
using namespace std;
//namespace mp = boost::multiprecision;
//using llll = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
//using Real = mp::number<mp::cpp_dec_float<1024>>;
using ll = long long;
const double EPS = 1e-10;
const ll MOD = 7+(1e+9);

int main(){
  //cout<<fixed<<setprecision(10);
  ll ans=0;
  char n;
  cin>>n;
  n++;
  cout<<n<<endl;
}


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

int main() {
  int K;
  string S;
  cin >> K >> S;
  
  cout << S.substr(0,K);
  
  if (K<S.size()) {
    cout << "...";
  }
  
  cout << endl;

  
 
  
  
 
}


Measured memory_bytes: 3640
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<climits>
#include<set>
#include<utility>
using namespace std;
typedef long long int ll;
const ll MOD=1e9+7;

int main(){

	int a, b, ans=0;
	cin >> a >> b;
	int x=b-a;

	for(int i=1; i<=x; i++){
		ans+=i;
	}
	cout << ans-b << endl;

	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long b = scan.nextLong();
		scan.close();
		long[]ans = extendedGCD(a, b);
		System.out.println(ans[0] + " " + ans[1]);
	}
	// as + bt = gcd(a, b)
    static long[] extendedGCD(long a, long b) {
        long s = 0, old_s = 1;
        long t = 1, old_t = 0;
        long r = b, old_r = a;
        while(r != 0) {
            long q = old_r / r;
            long old_s0 = old_s, old_t0 = old_t, old_r0 = old_r;
            old_s = s;
            s = old_s0 - q * s;
            old_t = t;
            t = old_t0 - q * t;
            old_r = r;
            r = old_r0 - q * r;
        }
        return new long[] {old_s, old_t};
    }
}


Measured memory_bytes: 26336
#include <stdio.h>

#include <map>
using namespace std;
 
int main( void )
{
	int N,M ;
	scanf("%d %d", &N, &M ) ;
	map<int,int> o;
	for( int n = 0 ; n < N ; n++ ) {
		int a, b ;
		scanf("%d %d", &a, &b) ;
		o[a]+=b;
	}
	long long p=0;
	for( const auto & v : o ) {
		long long n = min( M, v.second ) ;
		p += n * v.first ;
		M -= n ;
		if( M <= 0 ) break ;
	}
	printf("%ld\n", p ) ;
	return 0 ;
}


Measured memory_bytes: 4864
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

ll C[55][55];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	rep(i, 55){
		C[i][0] = C[i][i] = 1LL;
		repn(j, 1, i){
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]);
		}
	}
	int n, a, b;
	cin >> n >> a >> b;
	vector<ld> v(n);
	rep(i, n) cin >> v[i];
	sort(all(v));
	reverse(all(v));
	ld sum = 0;
	rep(i, a) sum += v[i];
	sum /= (ld)(a);
	cout << fixed << setprecision(10) << sum << endl;
	int ind = a - 1;
	int cnt = 1;
	int l = 0;
	while(ind < n && v[ind] == v[a - 1]) ind++, cnt++;
	ind = a - 1;
	while(ind >= 0 && v[ind] == v[a - 1]) ind--, cnt++, l++;
	cnt -= 2;
	if(ind == -1){
		ll ans = 0;
		repn(i, a, min(b + 1, cnt + 1)) ans += C[cnt][i];
		cout << ans << endl;
	}
	else{
		cout << C[cnt][l] << endl;
	}
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


Measured memory_bytes: 256
using System;

namespace ConsoleApplication36
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 0;
            string s = Console.ReadLine();
            string[] ss = s.Split(' ');
            int a = int.Parse(ss[0]);
            int b = int.Parse(ss[1]);
            int c = int.Parse(ss[2]);
            int x;
            for(x = a; x <= b; x++)
            {
                int y = c % x;
                if(y == 0)
                {
                    i = i + 1;
                }
            }
            Console.WriteLine(i);
        }
    }
}

Measured memory_bytes: 9080
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

int dp[MX];

int main() {
  int n;
  scanf("%d",&n);
  vi h(n);
  cin>>h;
  h.pb(INF);
  h.pb(INF);
  rep(i,n) dp[i] = INF;
  dp[0] = 0;
  rep(i,n) {
    mins(dp[i+1], dp[i]+abs(h[i]-h[i+1]));
    mins(dp[i+2], dp[i]+abs(h[i]-h[i+2]));
  }
  cout<<dp[n-1]<<endl;
  return 0;
}






















Measured memory_bytes: 1024
/**In The Name Of Allah*/

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

using namespace std;
#define pri(n)          printf("%d\n",n)
#define prll(n)         printf("%lld\n",n)
#define prd(n)          printf("%lf\n",n)
#define scll(n)         scanf("%lld",&n)
#define sci(n)          scanf("%d",&n)
#define scd(n)          scanf("%lf",&n)
#define pi              acos(-1)//inbuilt M_PI
#define ll              long long
#define pb              push_back
#define vsort(v)        sort(v.begin(),v.end())
#define asort(n)        sort(ar,ar+n)
#define yes             cout<<"Yes\n"
#define no              cout<<"No\n"
#define for1(i,n)       for(i=1;i<=n;i++)
#define for0(i,n)       for(i=0;i<n;i++)
#define mod             1000000007
#define watch(x)        cout << (#x) << " is " << (x) <<"\n";


int main()
{
    /*freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);*/
    /*ios_base::sync_with_stdio(false);
    cin.tie(NULL);/**Dont't use scanf of printf*/
    ll i,a,b,len,l,r,d,n,t,minn,sum=0,cnt,odd;
    cin>>l>>r>>d;
    if(l%d==0)  cout<<(r/d)-(l/d)+1<<endl;
    else cout<<(r/d)-(l/d)<<endl;


    return 0;
}


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

int main()
{
	int n,num,state;
	cin >> n;
	for (int l = 0; l < n; l++)
	{
		int day = 333 * 200 + 666 * 195;
		for (int i = 0; i < 3; i++)
		{
			cin >> num;
			switch (i)
			{
			case 0:
				state = (num % 3 == 0) ? 1 : 0 ;
				day -= int((num - 1) / 3) * 200 + ((num - 1) - int((num - 1) / 3)) * 195;
				break;
			case 1:
				if (state == 1)day -= (num - 1) * 20;
				else  day -= (num - 1) * 20 - int((num - 1) / 2);
				break;
			case 2:
				day -= num-1;
				break;
			}
		}
		cout << day << endl;
	}
	return 0;
}

Measured memory_bytes: 1160