akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int y = scan.nextInt();
		int z;
		//??????????????????????????????
		//??´??° x, y(x >= y)??????????????? x ??¨ y ????????§??¬?´???°??? y ??¨ x % y ????????§??¬?´???°???????????????
		//????????§ x % y ??? x ??? y ??§?????£???????????§??????
		do{
			z = Math.max(x, y) % Math.min(x, y);
			if(z == 0){
				System.out.println(Math.min(x, y));
			}
			else{
				if(x > y){x = z;}
				else{y = z;}
			}
		}while(z != 0);
	}
}

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

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

const int INF = 1e9 + 7;

using namespace std;



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

	int n, m;
	cin >> n >> m;

	vector<int> a(m);
	vector<int> b(m);
	vector<vector<int>> c;
	rep (i, 0, m) {
		cin >> a[i] >> b[i];
		vector<int> tmp(b[i]);
		rep (j, 0, b[i])
			cin >> tmp[j];
		c.push_back(tmp);
	}

	vector<vector<int>> dp(10000, vector<int>(10000, INF));
	dp[0][0] = 0;

	for (int i = 0; i < m; i++) {
		int open_id = 0;
		for (int j = 0; j < b[i]; j++)
			open_id |= (1 << (c[i][j] - 1));

		dp[i + 1] = dp[i];
		for (int j = 0; j < (1 << n); j++) {
			dp[i + 1][j | open_id] = min({dp[i + 1][j | open_id], dp[i][j | open_id], dp[i][j] + a[i]}); // dp[i][0]は常にゼロ
		}
	}

	if (dp[m][(1 << n) - 1] == INF)
		cout << -1 << endl;
	else
		cout << dp[m][(1 << n) - 1] << endl;

	return 0;
}


Measured memory_bytes: 391424
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <sstream>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif
 
int main(){
	std::vector<std::vector<int> > pcm(2);
	std::set<int> t;
	std::vector<int> t_vec;
	std::vector<int> counters;
	std::string buf;
	int idx = 0;
	int c;
	char tmp, d;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	while(std::getline(ifs, buf)){
#else
	while(std::getline(std::cin, buf)){
#endif
		if(buf == ""){
			idx++;
			continue;
		}
		std::istringstream stream(buf);

		stream >> c >> tmp >> d;
		pcm[idx].push_back(c);
	}
 
	for(int i = 0; i < pcm[0].size(); i++){
		for(int j = 0; j < pcm[1].size(); j++){
			if(pcm[0][i] == pcm[1][j]){
				t.insert(pcm[0][i]);
				break;
			}
		}
	}

	for(std::set<int>::iterator it = t.begin(); it != t.end(); it++){
		t_vec.push_back(*it);
	}

	std::sort(t_vec.begin(), t_vec.end());

	counters.resize(t_vec.size(), 0);

	for(int i = 0; i < t_vec.size(); i++){
		for(int j = 0; j < 2; j++){
			for(int k = 0; k < pcm[j].size(); k++){
				if(t_vec[i] == pcm[j][k]){
					counters[i]++;
				}
			}
		}
	}

	for(int i = 0; i < t_vec.size(); i++){
		std::cout << t_vec[i] << " " << counters[i] << std::endl;
	}

#if INPUT_FROM_FILE
	//fclose(fp);
#endif
    return 0;
}


Measured memory_bytes: 3164
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> void pr_vec(vector<T> &v, char ep=' '){int n=v.size();REP(ni,n){cout<<v[ni];if(ni!=n-1)cout<<ep;}cout<<endl;};
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    int N,M;
    cin >> N >> M;
    vector<vector<int>> c(N);
    REP(i, M){
        int a,b;
        cin >> a >> b;
        a--;b--;
        c[a].pb(b);
        c[b].pb(a);
    }

    queue<int> q;
    q.push(0);
    vector<int> ok(N,-1);
    ok[0] = 0;
    while(!q.empty()){
        auto f = q.front(); q.pop();
        for(auto&& ci : c[f]){
            if(ok[ci]==-1){
                ok[ci] = f+1;
                q.push(ci);
            }
        }
    }
    
    pr("Yes");
    Rep(i,1,N){
        pr(ok[i]);
    }
}

Measured memory_bytes: 10156
#![allow(unused_macros, unused_imports, dead_code, non_snake_case)]

use std::io;

fn read_line() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s
}

macro_rules! from_line {
    ($($a:ident : $t:ty),+) => {
        $(let $a: $t;)+
        {
            let _line = read_line();
            let mut _it = _line.trim().split_whitespace();
            $($a = _it.next().unwrap().parse().unwrap();)+
                assert!(_it.next().is_none());
        }
    };
}

fn main() {
    from_line!(A: i64, B: i64, C: i64, D: i64);
    if A + B < C + D {
        println!("Right");
    } else if A + B > C + D {
        println!("Left");
    } else {
        println!("Balanced");
    }
}


Measured memory_bytes: 4352
'''
lを求めたい
a * b // gで求める

a = a' * g
b = b' * g
l = a' * b' * g
a * b = l * g
'''
#a >= b
def gcd(a, b):
    r = (a % b)
    if r == 0:
        return b
    else:
        return gcd(b, r)

n = int(input())
t = sorted([int(input()) for _ in range(n)])

ans = t[0]
for i in range(1, n):
    ans *=  t[i] // gcd(ans, t[i])#gcd(small, big)
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef unsigned int INT;
typedef unsigned long long LONG;
typedef long long LL;
#define Foru(i, a, b) for(LONG i=(a);i<(b);++i)
#define Forl(i, a, b) for(LL i=(a);i>=(b);--i)
#define pb emplace_back
#define ft first
#define sd second
const int N = 100000 + 5;
const int INF = 0x3f3f3f3f;
const int MAXINT = 2147483647;
const int mod = 1000000007;
const long long MAXLONG = 9223372036854775807;
typedef pair<int, int> PII;
//读入输出外挂，只适用于整数，使用时流同步打开，C语言不准关流
//getchar()<<cin(关流)<<scanf()<<cin
template <class T>
inline bool read(T &ret) {
    char c;
    int sgn;
    if(static_cast<void>(c=getchar()),c==EOF) return 0;
    while(c!='-'&&(c<'0'||c>'9')) c=getchar();
    sgn=(c=='-')?-1:1;
    ret=(c=='-')?0:(c-'0');
    while(static_cast<void>(c=getchar()),c>='0'&&c<='9') ret=ret*10+(c-'0');
    ret*=sgn;
    return 1;
}
//输出只能用于正整数
template <class T>
inline void write(T x) {
    if(x>9) write(x/10);
    putchar(x%10+'0');
}

void slove(int question_num) {
    while(question_num--) {
        vector<int>a,b;
        int n,m,x;
        cin>>n>>m>>x;
        a.resize(n+1);b.resize(m+1);
        int u=9999999,p=9999999;
        for(int i=1;i<=n;++i) read(a[i]),u=min(u,a[i]);
        for(int i=1;i<=m;++i) read(b[i]),p=min(p,b[i]);
        int ans=u+p;
        for(int i=1;i<=x;++i)
        {
            int x1,y1,c;
            read(x1);read(y1);read(c);
            ans=min(ans,a[x1]+b[y1]-c);
        }
        cout<<ans;
    }
}

int main() {
    //ios::sync_with_stdio(false);
    int num=1;
    //    read(num);
    slove(num);
    return 0;
}


Measured memory_bytes: 1024
package main

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

func main() {
	sc := NewScanner()
	_, A, B := sc.NextInt(), sc.NextInt(), sc.NextInt()

	if (B-A)%2 == 0 {
		fmt.Println("Alice")
	} else {
		fmt.Println("Borys")
	}

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


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

typedef long long ll;

int retNum(const char r)
{
    switch (r)
    {
    case 'A':
        return 4;

    case 'B':
        return 3;

    case 'C':
        return 2;

    case 'D':
        return 1;

    default:
        return 0;
    }
}
int main()
{
    int H1, M1, H2, M2, K;
    cin >> H1 >> M1 >> H2 >> M2 >> K;
    cout << (H2 - H1) * 60 + M2 - M1 - K << endl;
}


Measured memory_bytes: 3612
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<cassert>
#include<cassert>
#include<unordered_map>
#include<unordered_set>
#include<functional>
#include<queue>
#include<stack>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<sstream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<numeric>
#include<random>
#include<chrono>
#include<bitset>
using namespace std;

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define xx first
#define yy second
#define sz(x) (int)(x).size()
#define gc getchar
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mp make_pair

#ifndef ONLINE_JUDGE
#  define LOG(x) (cerr << #x << " = " << (x) << endl)
#else
#  define LOG(x) ((void)0)
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const double PI=3.1415926535897932384626433832795;
const ll INF = 1LL<<62;
const ll MINF = -1LL<<62;

template<typename T> T getint() {
	T val=0;
	char c;
	
	bool neg=false;
	while((c=gc()) && !(c>='0' && c<='9')) {
		neg|=c=='-';
	}

	do {
		val=(val*10)+c-'0';
	} while((c=gc()) && (c>='0' && c<='9'));

	return val*(neg?-1:1);
}

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); uniform_int_distribution<int>(0, n-1)(rng)

vector<int> adj[200001];
int n;
ll dp[200001];
ll ans[200001];
int sz[200001];
ll fakt[200001];
const ll mod=1e9+7;
ll fp(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1) {
			res=(res*a)%mod;
		}
		
		a=a*a%mod;
		b/=2;
	}
	
	return res;
}

void dfs1(int x, int par=-1) {
	sz[x]=1;
	vector<int> lst;
	for(auto i:adj[x]) {
		if(par==i) continue ;
		dfs1(i, x);
		lst.pb(i);
		sz[x]+=sz[i];
	}
	
	if(lst.empty()) {
		dp[x]=1;
		return ;
	}
	
	ll res=fakt[sz[x]-1];
	for(int i:lst) {
		//~ cerr<<x<<"->"<<i<<"\n";
		//~ cerr<<sz[i]<<" "<<sz[x]-1<<"\n";
		res=(res*fp(fakt[sz[i]], mod-2))%mod;
		//~ cerr<<res<<"!\n";
		res=(res*dp[i])%mod;
	}
	
	dp[x]=res;
}

void dfs2(int x, int par=-1) {
	if(par==-1) ans[x]=dp[x];
	else {
		ans[x]=dp[x];
		ans[x]=ans[x]*fp(fakt[sz[x]-1], mod-2)%mod;
		//~ ans[x]=ans[x]*fp(fakt[n-sz[x]], mod-2)%mod;
		
		ans[x]=ans[x]*ans[par]%mod;
		ans[x]=ans[x]*fakt[sz[x]]%mod;
		ans[x]=ans[x]*fp(dp[x], mod-2)%mod;
		ans[x]=ans[x]*fp(n-sz[x], mod-2)%mod;
	}
	
	for(auto i:adj[x]) {
		if(i!=par) dfs2(i,x);
	}
}


int main() {
	IO;
	fakt[0]=1;
	for(int i=1;i<=200000;++i) {
		fakt[i]=fakt[i-1]*i%mod;
	}
	cin>>n;
	for(int i=0;i<n-1;++i) {
		int a,b;
		cin>>a>>b;
		adj[a].pb(b);
		adj[b].pb(a);
	}
	dfs1(1);
	dfs2(1);
	//~ cerr<<dp[2]<<"\n";
	//~ cerr<<dp[1]<<"\n";
	//~ cerr<<dp[3]<<"\n";
	for(int i=1;i<=n;++i) cout<<ans[i]<<"\n";
	
	return 0;
}


Measured memory_bytes: 19556
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    int n; cin>>n;
    cout<<180*(n-2)<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <map>
#include <cmath>
#include <algorithm>
#include <queue>
#include <cstdarg>
#include <set>

using namespace std;
#define INF 2e9 + 9
#define ALL(v) v.begin() , v.end()
#define Int int64_t
#define pll pair<Int,Int>
template<class T> using pql = priority_queue<T, vector<T>>;
template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;
#define ll(n) Int n; cin >> n;
#define LL(...) Int __VA_ARGS___; cin >> __VA_ARGS___;
#define OUT(...) cout << __VA_ARGS___;
#define RP(n, i, s) for(Int i = s ;i < n ;i++)
#define REP(n, i) for (Int i = 0; i < n; i++)
#define REPe(n, i) for (Int i = 1; i <= n; i++)
#define RPe(n, i, s) for (Int i = s; i <= n; i++)
#define upd_max(maxer, updater) if (maxer < updater) maxer = updater;

struct node {
    Int to;
    Int length;
};


vector<Int> divisor(Int n) {
    vector<Int> ret;
    for (Int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    return (ret);
}


vector<vector<int>> to;
vector<int> flag;
vector<int> c;

Int dfs(int from, int mae) {
    flag[from] = 1;
    Int mini = 0;
    for (auto next : to[from]) {
        if (next == mae) continue;
        if (flag[next] == 1) {
            return -1;
        } else {
            mini = min(mini, dfs(next, from));
        }
    }
    return mini;
}

int dx8[8] = {0, -1, -1, -1, 0, 1, 1, 1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};



int main(void) {
    Int n;
    cin >> n;
    Int miner = 1000;
    Int maxer = 0;
    REP(n,i){
        Int x;
        cin >> x;
        maxer = max(x,maxer);
        miner = min(x,miner);
    }
    cout << maxer - miner << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<math.h>
#include<vector>
#include<algorithm>
#include<array>
#include<functional>
#include<iomanip>
#include<ios>
using namespace std;
#define FOR(i,n) for(int (i)=0;(i)<(n);(i)++)

typedef int value_type; /* ソートするキーの型 */

value_type med3(value_type x, value_type y, value_type z)
/* x, y, z の中間値を返す */
{
    if (x < y)
        if (y < z) return y; else if (z < x) return x; else return z; else
        if (z < y) return y; else if (x < z) return x; else return z;
}

void quicksort(value_type a[], int left, int right,value_type index[])
/* クイックソート
 * a     : ソートする配列 
 * left  : ソートするデータの開始位置
 * right : ソートするデータの終了位置
 * index: index配列
 */
{
    if (left < right) {
        int i = left, j = right;
        value_type tmp, pivot = med3(a[i], a[i + (j - i) / 2], a[j]); /* (i+j)/2ではオーバーフローしてしまう */
        while (1) { /* a[] を pivot 以上と以下の集まりに分割する */
            while (a[i] < pivot) i++; /* a[i] >= pivot となる位置を検索 */
            while (pivot < a[j]) j--; /* a[j] <= pivot となる位置を検索 */
            if (i >= j) break;
            tmp = a[i]; a[i] = a[j]; a[j] = tmp; /* a[i],a[j] を交換 */
            tmp = index[i]; index[i] = index[j]; index[j] = tmp;
            i++; j--;
        }
        quicksort(a, left, i - 1,index);  /* 分割した左を再帰的にソート */
        quicksort(a, j + 1, right,index); /* 分割した右を再帰的にソート */
    }
}


int dfs(int n,int N){
    if (n>N){
        return 0;
    }
    

    int ret;
    
    return ret;
}
int main(){
    int X,Y,Z;
    cin>>X>>Y>>Z;

    long ans;

    X-=Z;

    ans=X/(Y+Z);
    
    cout<<ans<<endl;


    return 0;
}

Measured memory_bytes: 256
X = int(input())
fact = [1]
for i in range(2, 40):
  cnt = 1
  p = i
  while(p <= 1000):
    if(cnt >= 2):
      fact.append(p)
    p = p*i
    cnt += 1
fact.sort()
ans = 0
for n in fact:
  if(n <= X):
    ans = n
  else:
    break
print(ans)

Measured memory_bytes: 38256
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long int
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,k;
map<ll,ll>m;
int32_t main(){
CODE_START;
cin>>n>>k;
for(ll i=0;i<k;i++)
{
    ll cnt;
    cin>>cnt;
    for(ll j=0;j<cnt;j++)
    {
        ll x;
        cin>>x;
        m[x]=1;
    }
}
ll ans=0;
for(ll i=1;i<=n;i++)
if(m[i]!=1){
    ans++;
}
cout<<ans<<endl;
}


Measured memory_bytes: 3652
#include <iostream>

using namespace std;

static bool isVowel(const char c) {
	bool ret = false;

	switch (c) {
	case 'a':
	case 'e':
	case 'i':
	case 'o':
	case 'u':
		ret = true;
		break;
	default:
		ret = false;
		break;
	}
	return ret;
}

int main() {
	char c;

	cin >> c;

	if (isVowel(c)) {
		cout << "vowel" << endl;
	} else {
		cout << "consonant" << endl;
	}

	return 0;
}


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

int main() {
    int64_t N, K;
    cin >> N >> K;
    vector<int64_t> p(N);
    for (int64_t& e : p) {
        cin >> e;
    }

    vector<double> exp(N);
    for (int64_t i = 0; i < N; i++) {
        exp[i] += (p[i] + 1.0) / 2;
    }

    vector<double> sum(N + 1, 0);
    for (int64_t i = 0; i < N; i++) {
        sum[i + 1] = sum[i] + exp[i];
    }

    double ans = 0;
    for (int64_t i = 0; i <= N - K; i++) {
        ans = max(ans, sum[i + K] - sum[i]);
    }
    cout << setprecision(15) << ans << endl;
}

Measured memory_bytes: 4992
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b)for(int i=(a);i<=(b);i++)
#define repR(i,n) for(int i=n;i>=0;i--)
#define P pair<int, int>
#define sz(x) x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<int>
#define COUT(x) cout<<(x)<<endl
#define MA map<int,int>
#define SE set<int>
#define PQ priority_queue<int>
#define PQR priority_queue<int,VE,greater<int>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

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

using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {
	if (a < b)swap(a, 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;
}
bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
	if (a.second != b.second) {
		return a.second < b.second;
	}
	else {
		return a.first < b.first;
	}
}
const long long MOD = 1000000007;
const long long INF = 1LL << 50;
// pair -> vector<pair<int,int>> 
//		   AandB.push_back(make_pair(a[i],b[i]))


signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	int k; cin >> k;
	VE a(n); rep(i, n)cin >> a[i];
	int cnt = 0;
	rep(i, n) {
		if (a[i] >= k)cnt++;
	}
	cout << cnt << endl;
	return 0;
}

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

#define lli long long int
#define pb push_back
#define in insert
#define pi pair<lli, lli>
#define ps pair<double, string>
#define pib pair<pi, bool>
#define mp make_pair
#define fir first
#define sec second
#define MAXN 50
#define MAXL 10001
#define mod 1000000007

signed main()
{
  int a, b, h, m;
  cin >> a >> b >> h >> m;
  double angulo1, angulo2, angulo3;
  angulo1 = (m * 360.0) / 60.0;
  angulo2 = (h * 360.0) / 12.0;
  angulo2 += (m * 360.0) / 720.0;
  angulo3 = max(angulo1, angulo2) - min(angulo1, angulo2);
  if (angulo3 > 180)
    angulo3 = 360 - angulo3;
  angulo3 = (angulo3 / 360) * 2 * M_PI;
  double ans = sqrt(pow(a, 2) + pow(b, 2) - (2 * a * b * cos(angulo3)));
  cout << fixed << setprecision(15);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4136
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
typedef long long ll;
typedef pair<int,int> P;
int main() {
    int N,K;
    cin >> N >> K;
    vector<int> A(N);
    rep(i, 0, N){
        cin >> A[i];
    }
    rep(ki, 0, K){
        vector<int> B(N+1);
        rep(i, 0, N){
            int l = max(0, i-A[i]);
            int r = min(N, i+A[i]+1);
            
            B[l]++;
            B[r]--;
        }
        rep(i, 0, N){
            B[i+1] += B[i];
        }
        B.pop_back();
        if(A == B) break;
        A = B;
    }
    
    rep(i, 0, N){
        cout << A[i] << " ";
    }
    return 0;
}


Measured memory_bytes: 4816
#include <stdint.h>
#include <algorithm>
#include <bitset>
#include <functional>
#include <iostream>
#include <string>
#include <vector>

typedef struct {
  int time;
  int ch;
} TL;

int tl[512 * 1024];

int getBitCount(int n) {
  int c = 0;
  for (int i = 0; i < 31; i++) {
    c += n & 1;
    n >>= 1;
  }
  return c;
}

int main(int argc, char *argv[]) {
  int N, C;

  std::cin >> N >> C;
  for (int i = 0; i < N; i++) {
    int s, t, c;
    std::cin >> s >> t >> c;
    for (int k = s - 1; k < t; k++) {
      tl[k] |= (1 << c);
    }
  }
  int max = 0;
  for (int i = 0; i < 512 * 1024; i++) {
    int c = getBitCount(tl[i]);
    if (max < c) max = c;
  }
  std::cout << max << std::endl;
}


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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int mod = (int)1e9 + 7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

int main()
{
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n, m, ans =0;
	cin >>n >>m;
	vector<VI> r(n);
	VI rh(n), ct(n);
	rep(i,m){
		int x, y;
		cin >>x >>y;
		r[x-1].emplace_back(y-1);
		rh[y-1]++;
	}
	
	queue<int> q;
	rep(i, n) if(rh[i] ==0) q.emplace(i);
	while(!q.empty()){
		int v = q.front(); q.pop();
		for(auto u :r[v]){
			ct[u] = max(ct[u], ct[v]+1);
			ans = max(ans, ct[u]);
			rh[u]--;
			if(rh[u]==0) q.emplace(u);
		}
		
	}
	//for(auto x :ct) printf("%d, ",x); puts("");
	cout << ans <<"\n";
	return 0;
}


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

using ll = long long;

const int MAXN = 1010;
int N[3];
int K;

ll A[3][MAXN];

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	for (int i = 0; i < 3; i++) cin >> N[i];
	cin >> K;
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < N[i]; j++) {
			cin >> A[i][j];
		}
		sort(A[i], A[i] + N[i], greater<ll>());
	}

	using state = pair<ll, array<int, 3>>;
	priority_queue<state> q;
	q.push(make_pair(A[0][0]+A[1][0]+A[2][0], array<int, 3>({0, 0, 0})));		
	set<array<int, 3>> vis = {array<int, 3>{0, 0, 0}};
	for (int z = 0; z < K; z++) {
		assert(!q.empty());
		auto p = q.top();
		q.pop();
		cout << p.first << '\n';
		for (int i = 0; i < 3; i++) {
			if (p.second[i] == N[i]-1) continue;
			auto np = p;
			np.first += A[i][p.second[i]+1] - A[i][p.second[i]];
			np.second[i]++;
			if (vis.count(np.second)) continue;
			vis.insert(np.second);
			q.push(np);
		}
	}

	return 0;
}


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

struct p{
    int x,y,z;
};

int main(){
    p c[3] = {};

    for(int i = 0; i < 3; ++i){
        cin >> c[i].x >> c[i].y >> c[i].z;
    }

    p a;

    for(int i = 0; i <= 100; ++i){
        a.x = c[0].x - i;
        a.y = c[0].y - i;
        a.z = c[0].z - i;
        int j = c[1].x - a.x;
        int k = c[2].x - a.x;
        if(j + a.y == c[1].y && j + a.z == c[1].z && k + a.y == c[2].y && k + a.z == c[2].z){
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
}

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

int main() {
  int h1,h2,m1,m2,k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  cout << (h2-h1-1)*60+m2+(60-m1)-k;
}

Measured memory_bytes: 3640
#include <stdio.h>
#include <string.h>

#define M 2000003
#define L 14

char H[M][L]; /* Hash Table */

int getChar(char ch){
  if ( ch == 'A') return 1;
  else if ( ch == 'C') return 2;
  else if ( ch == 'G') return 3;
  else if ( ch == 'T') return 4;
}

/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){ return key%M; }
int h2(int key){ return 1+(key%(M-1)); }

int find(char str[]){

  long long key,i,h;
  key=getKey(str);
  i=0;
  while(1){
    h=(h1(key)+i*h2(key))%M;
    if(strcmp(H[h],str)==0) return 1;
    else if(strlen(H[h])==0) return 0;
    i++;
  }
}

int insert(char str[]){

  long long key,i,h;
  key=getKey(str);
  i=0;
  while(1){
    h=(h1(key)+i*h2(key))%M;
    if(strcmp(H[h],str)==0) return 1;
    else if(strlen(H[h])==0){
      strcpy(H[h],str);
      return 0;
    }
    i++;
  }
}

int main(){
    int i, n, h;
    char str[L], com[9];
    for ( i = 0; i < M; i++ ) H[i][0] = '\0';
    
    scanf("%d", &n);
    
    for ( i = 0; i < n; i++ ){
	scanf("%s %s", com, str);
	
	if ( com[0] == 'i' ){
	    insert(str);
	} else {
	    if (find(str)){
		printf("yes\n");
	    } else {
		printf("no\n");
	    }
	}
    }

    return 0;
}

  



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

int main()
{
    string t = "CODEFESTIVAL2016";
    string S;
    cin >> S;

    int count = 0;
    for(int i = 0; i < t.size(); i++) {
        if(S[i] != t[i]) {
            count += 1;
        }
    }
    cout << count << endl;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Globalization;
using System.Linq;

namespace Contest
{
    class Scanner
    {
        private string[] line = new string[0];
        private int index = 0;

        public string Next()
        {
            if (line.Length <= index)
            {
                line = Console.ReadLine().Split(' ');
                index = 0;
            }

            var res = line[index];
            index++;
            return res;
        }

        public int NextInt()
        {
            return int.Parse(Next());
        }

        public long NextLong()
        {
            return long.Parse(Next());
        }

        public ulong NextUlong()
        {
            return ulong.Parse(Next());
        }

        public string[] Array()
        {
            line = Console.ReadLine().Split(' ');
            index = line.Length;
            return line;
        }

        public int[] IntArray()
        {
            var array = Array();
            var result = new int[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                result[i] = int.Parse(array[i]);
            }

            return result;
        }

        public long[] LongArray()
        {
            var array = Array();
            var result = new long[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                result[i] = long.Parse(array[i]);
            }

            return result;
        }
    }

    class Program
    {
        private string S;
        private void Scan()
        {
            var sc = new Scanner();
            S = sc.Next();
        }

        public void Solve()
        {
            Scan();
            long ans = 0;
            int cnt = 0;
            for (int i = 0; i < S.Length; i++)
            {
                if (S[i] == 'W')
                {
                    ans += i - cnt;
                    cnt++;

                }
            }
            Console.WriteLine(ans);
        }

        static void Main() => new Program().Solve();
    }


}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define ll long long
#define endl '\n'
#define pi 3.14159265
ll n,W;
ll w[101];
ll v[101];
ll dp[500001][101];
ll f(ll q,ll i)
{
    if(i==n)
    {
        if(q<=W)
        return 0;
        return -1e18;
    }
    if(dp[q][i]!=-1)
        return dp[q][i];
    ll ans=f(q,i+1);
    if(q+w[i]<=W)
        ans=max(ans,f(q+w[i],i+1)+v[i]);
    return dp[q][i]=ans;
}
int main()
{
    IOS;
    cin>>n>>W;
    for(ll i=0;i<n;i++)
        cin>>w[i]>>v[i];
    memset(dp,-1,sizeof(dp));
    cout<<f(0,0);
}

Measured memory_bytes: 394752
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

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

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

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

	int n, a, b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	int tot = 0;
	
	int si = s.size();
	int bi = 0;
	rep(i, si) {
		bool ok = false;
		if (s[i] == 'a' && tot < a + b) {
			ok = true;
			tot++;
		} else if (s[i] == 'b' && tot < a + b && bi < b) {
			bi++;
			ok = true;
			tot++;
		}
		if (ok) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}


Measured memory_bytes: 848
#include <bits/stdc++.h>
using namespace std;
int main(){
  
  int N;
  cin >> N;
  
  vector<long long> T(N,0);
  map<long long,long long> A;
  
  for(long long i=0; i<N; i++){
    cin >> T.at(i);
    A[T.at(i)+i]++;
  }
 
  long long count=0;
    
  for(long long i=0; i<N; i++){
    count+=A[i-T.at(i)];
  }
  cout << count << endl;
}

Measured memory_bytes: 27452
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long LL;
template <typename F, typename S> std::ostream& operator<<(ostream& os, const pair<F,S>& p) {
    os << "(" << p.first << "," << p.second << ")"; return os; }
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "["; for(const T& a: v){ os << a << ", "; } os << "]"; return os; }
template <typename K, typename V> ostream& operator<<(ostream& os, const map<K,V>& m) {
    os << "{"; for(const auto& p: m){ os << p.first <<":"<< p.second << ", "; } os << "]"; return os; }


// import here

int main(){
    LL n;
    cin >> n;
    vector<LL> a(n);
    for(LL i = 0; i < n; ++i){
        cin >> a[i];
    }
    if(a[0] > 0){
        cout << -1 << endl;
        return 0;
    }

    LL ans = 0;
    a.push_back(0);
    for(LL i = n-1; i >= 0; --i){
        if(a[i] > a[i+1]-1){
            ans += a[i];
        }else if(a[i] == a[i+1]-1){
        }else{
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
    return 0;
}



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

int main() {
    int n;
    string result = "No";
    cin >> n;

    int i, j;
    for(i = 0; i < n / 7 + 1; i++){
        for(j = 0; j < n / 4 + 1; j++){
            if ((7 * j) + (4 * i) == n) {
                result = "Yes";
            }
        }
    }
    for(i = 0; i < n / 4 + 1; i++){
        for(j = 0; j < n / 7 + 1; j++){
            if ((7 * j) + (4 * i) == n) {
                result = "Yes";
            }
        }
    }
    cout << result << endl;
}


Measured memory_bytes: 256
#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 MOD 1000000007
#define INF (1LL<<57)
#define MV 200001
#define LMV 21
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define emp emplace
#define whoami(x) cerr<<#x<<" "<<x<<"\n";
#define mp make_pair
#define ins insert
#define sz size

void FLASH() {ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
void SETF() {cout.ios_base::setf(ios_base::fixed);}
void UNSETF() {cout.ios_base::unsetf(ios_base::fixed);}

typedef long long ll;
typedef long double ld;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef pair<PII, int> PPII;
typedef pair<PLL, ll> PPLL;
typedef map<int, int> MII;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct h_llint {
  static uint64_t splitmix64(uint64_t x) {    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};

struct h_pair{
  size_t operator()(const PLL&x)const{
    return hash<ll>()(((ll)x.ff)^(((ll)x.ss)<<32));
  }
};

typedef map<ll, ll> MLL;
typedef map<PII, int> MPII;
typedef map<PLL, ll> MPLL;
typedef set<int> SI;
typedef set<ll> SL;
//ordered_set = order_by_key(.)
//ordered_set = find_by_order(.)
typedef ordered_set<int> OSI;
typedef ordered_set<ll> OSL;
typedef ordered_multiset<int> MOSI;
typedef ordered_multiset<ll> MOSL;
typedef unordered_map<ll, int, h_llint> UMLI;
typedef unordered_map<ll, ll, h_llint> UMLL;
typedef unordered_map<PLL, int, h_pair> UMPI;
typedef unordered_map<PLL, ll, h_pair> UMPL;

int ar[MV];
ll arr[MV];

void solve(int T)
{
	int a,b;
	cin>>a>>b;
	for(int i=1;i<=1000000;i++)
	{
		int a1 = (i * 8)/100;
		int a2 = (i * 10)/100;
		if((a1 == a) && (a2 == b))
		{
			cout<<i<<"\n";
			return;
		}		
	}
	cout<<"-1\n";
	return;	
}

int main(void)
{
	FLASH();
	int T;
	T = 1;

// #ifndef ONLINE_JUDGE
// 	time_t time_t1, time_t2;
// 	time_t1 = clock();
// #endif

	while(T--)
	solve(T);

// #ifndef ONLINE_JUDGE
// 	time_t2 = clock();
// 	SETF();
// 	cout<<"Time taken: "<<setprecision(7)<<(time_t2 - time_t1)/(double)CLOCKS_PER_SEC<<"\n";
// 	UNSETF();
// #endif

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define vec vector
#define vi vec<int>
#define vvi vec<vec<int>>
#define ALL(a) begin(a), end(a)
#define RALL(a) rbegin(a), rend(a)
#define SORT(a) stable_sort(ALL(a))
#define RSORT(a) stable_sort(RALL(a))
#define REV(a) reverse(ALL(a))
#define UNIQUE(a) a.erase(unique(ALL(a)), end(a))
#define lambda(i) [](auto& i)
#define compare(i, j) [](auto& i, auto& j)
#define min_of(a) *min_element(ALL(a))
#define max_of(a) *max_element(ALL(a))
#define sum(a) accumulate(ALL(a), 0)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define SZ(a) (int)(a).size()
#define REP(i, n) for (decltype(+n) i = 0; i < (n); i++)
#define RREP(i, n) for (auto i = n - 1; i != static_cast<decltype(i)>(-1); i--)
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define RFOR(i, a, b) for (auto i = b - 1; i != a; i--)
#define EACH(i, a) for (auto&& i: (a))
using namespace std;

const int INF = 1e18;
const int MOD = 1e9 + 7;

struct union_find {
  vi data;
  union_find(int size) : data(size, -1) { }
  bool union_set(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool find_set(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  int size(int x) {
    return -data[root(x)];
  }
};

vi cum(vi V) {
  vi U(SZ(V));
  partial_sum(ALL(V), begin(U));
  return U;
}

void solve() {
  int n;
  int ans = 0;

  cin >> n;
  vi v(5);
  REP(i, 5) {
    cin >> v[i];
    int l_min = INF;
    REP(j, i + 1)l_min = min(l_min, v[j]);
    ans = max(ans, (n - 1) / l_min + 1 + i);
  }

  cout << ans << endl;
  // REP(i, n) {
  //   cout << v[i];
  // }
}

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(15);
  solve();
}


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

class Program {
    static void Main(string[] args) {
        string a = Cin.Next();
        string b = Cin.Next();
        for (int i = 0; i < a.Length; i++) {
            if (a[i] != b[b.Length - i - 1]) {
                Console.WriteLine("NO");
                return;
            }
        }
        Console.WriteLine("YES");
    }
}


public class Cin {
    private static string[] s = new string[0];
    private static int i = 0;

    private static char[] cs = new char[] { ' ' };

    public static string Next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        i = 0;
        return Next();
    }

    public static int Ni() {
        return int.Parse(Next());
    }

    public static long NextLong() {
        return long.Parse(Next());
    }

    public static double NextDouble() {
        return double.Parse(Next());
    }

}


Measured memory_bytes: 13140
while True:
    n = input()
    if n == 0:
        break
    n8 = oct(n)
    tmp = list(n8)
    strlen = len(tmp)
    for i in range(strlen):
        if tmp[i] == "4":
            tmp[i] = "5"
        elif tmp[i] == "5":
            tmp[i] = "7"
        elif tmp[i] == "6":
            tmp[i] = "8"
        elif tmp[i] == "7":
            tmp[i] = "9"
    print "%s" % "".join(tmp)[1:]

Measured memory_bytes: 6292
{-# OPTIONS_GHC -O3 #-}
{-# LANGUAGE ViewPatterns, ScopedTypeVariables #-}

import qualified Data.ByteString as B (getLine)
import qualified Data.ByteString.Char8 as C (readInt, words, unpack, reverse, dropWhile)
import qualified Data.Maybe as M (fromJust)
import Data.Char as C (isSpace)

readInt = fst . M.fromJust . C.readInt
rstrip = C.reverse . C.dropWhile C.isSpace . C.reverse

main = do
    (map readInt . C.words -> [n]) <- B.getLine
    (map readInt . C.words -> [a]) <- B.getLine
    putStrLn $ show $ (n * n - a)


Measured memory_bytes: 380
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

internal static class CR
{
    public static string Get() { return Console.ReadLine(); }
    public static IEnumerable<string> GetTexts() { return Console.ReadLine().Split(' '); }
    public static int GetInteger() { return int.Parse(Console.ReadLine()); }
    public static IEnumerable<int> GetIntegers() { return Console.ReadLine().Split(' ').Select(x => int.Parse(x)); }
}

namespace AtCoder.A
{
    public class Program
    {
        public static int H { get; private set; }
        public static int A { get; private set; }

        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var inputs = CR.GetIntegers().ToList();
            H = inputs[0];
            A = inputs[1];

            var count = 0;
            while (H > 0)
            {
                count++;
                H -= A;
            }

            return count;
        }
    }
}


Measured memory_bytes: 11348
def getKth(x, a, k):
    if(k < a):
        return k
    return k + 1
def getRKth(x, a, k):
    if(x < a):
        return x - k + 1
    if(k < (x - a)):
        return x - k + 1
    return x - k
def NB(x, b):
    if(x < b):
        return x
    return x + 1
def f(x, a, b):
    mv = 25
    half = (x + 1) / 2
    rep = 0
    for delta in xrange(-mv, mv + 1):
        if(half + delta >= 1 and half + delta <= x):
            rep = max(rep, getKth(x, a, half + delta) * getRKth(NB(x, b), b, half + delta))
    half = b - a
    for delta in xrange(-mv, mv + 1):
        if(half + delta >= 1 and half + delta <= x):
            rep = max(rep, getKth(x, a, half + delta) * getRKth(NB(x, b), b, half + delta))
    half = NB(x, b) - b
    for delta in xrange(-mv, mv + 1):
        if(half + delta >= 1 and half + delta <= x):
            rep = max(rep, getKth(x, a, half + delta) * getRKth(NB(x, b), b, half + delta))
    return rep
q = int(raw_input())
while(q > 0):
    a, b = map(int, raw_input().split())
    if(a > b):
        a, b = b, a
    lo = 1
    hi = 10**19
    res = 0
    # print f(1, a, b)
    # print f(2, a, b)
    # print f(3, a, b)
    # print getKth(2, a, 1), getRKth(NB(2, b), b, 1)
    # print getKth(2, a, 2), getRKth(NB(2, b), b, 2)
    while(lo <= hi):
        mid = (lo + hi)/2
        if(f(mid, a, b) < a * b):
            lo = mid + 1
            res = mid
        else:
            hi = mid - 1
    print res
    q -= 1


Measured memory_bytes: 2760
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rREP(i,m,n) for(int (i)=(n)-1; (i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;

template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	map<int, int>mp;
	rep(i, 0, N) {
		int a; cin >> a;
		mp[a]++;
	}
	if (mp[0] == N) {
		puts("Yes");
		return 0;
	}
	else if (N % 3) {
		puts("No");
		return 0;
	}
	vector<int>vec;
	for (auto p : mp) {
		if (p.second % (N / 3)) {
			puts("No");
			return 0;
		}
		rep(i, 0, p.second / (N / 3))vec.push_back(p.first);
	}
	if ((vec[0] ^ vec[1] ^ vec[2]) == 0) puts("Yes");
	else puts("No");

	return 0;
}

Measured memory_bytes: 3840
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
using namespace std;

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

int main(){
    ll N, C, K;
    cin >> N >> C >> K;
    vector<ll> T(N);
    rep(i, N) cin >> T[i];
    sort(T.begin(), T.end());
    vector<ll> T_lim(N);
    rep(i, N) T_lim[i] = T[i] + K;

    ll bus_cnt = 0;
    for(int i = 0; i < N; ){
        int p = i;
        i++;
        while(T_lim[p] >= T[i] && i < N && i < p + C){
            i++;
        }
        bus_cnt++;
    }
    cout << bus_cnt << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, -1, 0, 1 };

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

signed main() {
	int N;
	cin >> N;

	vector<int> a(N);
	rep(i, N) cin >> a[i];

	int sum = 0;
	rep(i, N) sum += a[i];

	double ave = (double)sum / N;

	int minIdx = 0;
	double minDiff = INT_MAX;

	rep(i, N) {
		double diff = abs(ave - a[i]);
		if (diff + 0.00000001 < minDiff) {
			minIdx = i;
			minDiff = diff;
		}
	}

	cout << minIdx << endl;

    return 0;
}


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

using namespace std;

string s;
long d[100],n;

int main()
{
    cin >> s;
    n=s.length();
    s=" "+s;
    //cout << s;
    for (long i=1;i<=n;i++){
        if (s[i]==s[i+2]) {
            cout << i << " " << i+2;
            return 0;
        }
        if (s[i]==s[i+1]) {
            cout <<i << " " << i+1;
            return 0;
        }

    }

    cout << -1 << " " << -1;
    return 0;
}


Measured memory_bytes: 512
(function(input) {
    var p = input.split('\n');
    var n = p.shift();
    var a = p.shift().split(' ', n).map(Number);
    sortBubble(a);
})(require('fs').readFileSync('/dev/stdin', 'utf8'));

function sortBubble(a) {
    var count = 0;
    var flag = true;
    while (flag) {
        flag = false;
        for (var i = a.length - 1; i >= 1; i--) {
            if (a[i] < a[i - 1]) {
                var tmp = a[i];
                a[i] = a[i - 1];
                a[i - 1] = tmp;
                flag = true;
                count++
            }
        }
    }
    console.log(a.join(' '));
    console.log(count);
}

Measured memory_bytes: 7908
using System;
namespace b
{
    class Program
    {
        static void Main(string[] args)
        {

            var line = Console.ReadLine();
            var data = line.Split(" ");
            var d = int.Parse(data[0]);
            var n = int.Parse(data[1]);
            if (n==100)
            {
                Console.WriteLine(Math.Pow(100,d)*(n+1));
            }
            else
            {
                Console.WriteLine(Math.Pow(100,d)*n);
            }
        }
    }
}

Measured memory_bytes: 27184