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

using namespace std;

#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"

typedef long long ll;
typedef unsigned long long ul;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll, V, greater<ll>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18;

struct Edge {
    ll cost, from, to;
    bool operator<(const Edge &another) const { return cost < another.cost; };
    bool operator>(const Edge &another) const { return cost > another.cost; };
};
ll N, M;
vector<Edge> es;
VL d;

void berman(ll s) {
    d.assign(N, LINF);
    d[s] = 0;
    REP(loop, N) {
        REP(i, SZ(es)) {
            Edge e = es[i];
            if(d[e.from] != LINF && d[e.to] > d[e.from] + e.cost) {
                d[e.to] = d[e.from] + e.cost;
                if(loop == N - 1 && e.to == N - 1) {
                    cout << "inf"
                         << "\n";
                    exit(0);
                }
            }
        }
    }
}

int main() {
    cin >> N >> M;
    REP(i, M) {
        LCIN(a, b, c);
        es.push_back({-c, --a, --b});
    }
    berman(0);
    cout << -d[N - 1] << "\n";
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} // rep(i, 5, 1) --> {4,3,2,1} // rep(it, end(v), begin(v)) --> *it

using namespace std;

int main()
{
    int x, y;
    cin >> x >> y;
    bool z = false;
    rep(i, 0, x + 1)
        rep(j, 0, x + 1)
        {
            if (i*2 + j*4 == y && i + j == x && i + j != 0)
                z = true;
        }
    cout << (z?"Yes":"No");
    return 0;
}

Measured memory_bytes: 3636
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = (long long)1e9 + 7; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}



signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	
	string s;
	
	cin>>s;
	
	if(s[0] == s[2]) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
int a,b,c,d,dp[3005][3005],pw[3005][3005],sum[2][3005][3005],prt[3005];
const int mod=998244353;
int M(int x){return x>=mod?x-mod:x;}
int mypow(int a,int b)
{
	int ans=1;
	while(b)
	{
		if(b&1)ans=1ll*ans*a%mod;
		a=1ll*a*a%mod;
		b>>=1;
	}
	return ans;
}
int main()
{
	for(int i=1;i<=3000;i++)
	{
		pw[i][1]=mypow(i,mod-2);
		for(int j=2;j<=3000;j++)pw[i][j]=1ll*pw[i][j-1]*pw[i][1]%mod;
	}
	for(int i=1;i<=3000;i++)prt[i]=mypow(i,3000);
	scanf("%d%d%d%d",&a,&b,&c,&d);
	dp[a][b]=1;
	for(int i=a;i<=c;i++)
	{
		for(int j=b;j<=d;j++)
		{
			sum[0][i][j]=(1ll*sum[0][i][j]+1ll*sum[0][i-1][j]*j)%mod;
			sum[1][i][j]=(1ll*sum[1][i][j]+1ll*sum[1][i][j-1]*i)%mod;
			dp[i][j]=M(dp[i][j]+M(sum[0][i][j-1]+sum[1][i-1][j]));
			if(i<c&&j<d)dp[i+1][j+1]=(1ll*dp[i+1][j+1]+1ll*i*j*dp[i][j])%mod;
			if(i<c)
			{
				if(j==d)dp[i+1][j]=(1ll*dp[i+1][j]+1ll*j*dp[i][j])%mod;
				else sum[0][i+1][j]=(1ll*sum[0][i+1][j]+1ll*j*dp[i][j])%mod;
			}
			if(j<d)
			{
				if(i==c)dp[i][j+1]=(1ll*dp[i][j+1]+1ll*i*dp[i][j])%mod;
				else sum[1][i][j+1]=(1ll*sum[1][i][j+1]+1ll*i*dp[i][j])%mod;
			}
		}
	}
	printf("%d\n",dp[c][d]);
	return 0;
}

Measured memory_bytes: 142536
#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;

int main() {
  string s;
  cin >> s;
  unordered_map<char, int> cnt;
  for (char c: s) cnt[c] += 1;
  for (auto p: cnt) {
    if (p.second != 0 && p.second != 2) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 1 ;
int dp[MAXN] ;
int h[MAXN] ;
int main(){
    int n ;
    cin >> n ;
    for ( int i = 0 ; i < n ; i++ ){
        cin >> h[i] ;
    }
    dp[0] = 0 ;
    dp[1] = abs(h[1] - h[0] ) ;
    for ( int j = 2 ; j < n ; j++ ){
        dp[j] = min( dp[j-1] + abs(h[j] - h[j-1] ), dp[j-2] + abs(h[j] - h[j-2])) ;
    }
    cout << dp[n-1] ;
    return 0;
}


Measured memory_bytes: 1024
from numpy import*
M=10**9+7
n,*a=open(0)
n=int(n)
d=zeros(2**n,'u8')
d[0]=1
for a in a:
  b,d=d,zeros(2**n,'u8')
  for i,a in enumerate(map(int,a.split())):
    if a:
      j=2**i
      d[j:]+=b[:-j]
  d%=M
print(d[-1])

Measured memory_bytes: 63552
#include<iostream>
#include<vector>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<queue>
#include<map>
using namespace std;
int N;
int check=0;

int main(void){
 char s[150];
 long long int k;
 int cnt=0;
 
 cin>>s;
 cin>>k;

 for(int i=0; i<strlen(s); i++){
  if(s[i]=='1'){
   cnt++;
  }
  else break;
 }

 if(cnt>=k)std::cout<<1<<std::endl;
 else {
  for(int i=0; i<strlen(s); i++){
   if(s[i]!='1'){
    std::cout<<s[i]<<std::endl;
	return 0;
   }
  }
 }
 return 0;
}



Measured memory_bytes: 256
n = int(input())
if n % 9 == 0:
    a = n/9
    if a < 10:
        print("Yes")
    else:
        print("No")
elif n % 8 == 0:
    a = n/8
    if a < 10:
        print("Yes")
    else:
        print("No")
elif n % 7 == 0:
    a = n/7
    if a < 10:
        print("Yes")
    else:
        print("No")
elif n % 6 == 0:
    a = n/6
    if a < 10:
        print("Yes")
    else:
        print("No")
elif n % 5 == 0:
    a = n/5
    if a < 10:
        print("Yes")
    else:
        print("No")
elif n % 4 == 0:
    a = n/4
    if a < 10:
        print("Yes")
    else:
        print("No")
elif n % 3 == 0:
    a = n/3
    if a < 10:
        print("Yes")
    else:
        print("No")
elif n % 2 == 0:
    a = n/2
    if a < 10:
        print("Yes")
    else:
        print("No")
elif n == 1:
    print("Yes")
else :
    print("No")

Measured memory_bytes: 3064
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
typedef pair<int, int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);

int main() {
    ll n;
    cin>>n;
    vector<ll> a(n);
    rep(i,n){
        cin>>a[i];
    }
    ll ans=0;
    ll pre=0;
    for (int i = 0; i < n; ++i) {
        ll k=a[i]+pre;
        ans+=k/2;
        if(k%2&&a[i]>0){
            pre=1;
        }else{
            pre=0;
        }
    }
    cout<<ans<<endl;



    return 0;
}


Measured memory_bytes: 1152
//
//  main.cpp
//  CP-C++
//
//  Created by ALOK KUMAR THAKUR on 05/05/20.
//  Copyright © 2020 ALOK KUMAR THAKUR. All rights reserved.
//

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define tc() ll T;cin>>T;while(T--)
#define pb push_back

struct cmp {
    bool operator() (const ll& a, const ll& b){
        return a < b;
    }
};

int main() {
    
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    
    /*-----------------Code Begins Here------------------*/
    
    ll n; cin>>n;
    set<ll> s;
    map<ll,ll> m;
    for(ll i=0;i<n;i++){
        ll x; cin>>x;
        s.insert(x);
        m[x]++;
    }
    ll l[s.size()], a=0;
    for(auto it:s) l[a++] = it;
    ll ans = 0;
    for(ll i=0;i<s.size();i++){
        for(ll j=i+1;j<s.size();j++){
            for(ll k=j+1;k<s.size();k++){
                if(l[i]+l[j]>l[k]) ans = ans + (m[l[i]]*m[l[j]]*m[l[k]]);
            }
        }
    }
    cout<<ans;
    
    /*------------------Code Ends Here-------------------*/
    
    return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
 
using namespace std;
 
using ll = long long;
using ld = long double;
using vi = vector<ll>;
using vvi = vector<vi>;
using pll = pair<ll, ll>;
 
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair

void solve() {
    ll n; cin >> n;
    ll MOD = 1e9+7;
    ll all = 1;
    for (int i = 0; i < n; i++) {
        all *= 10;
        all %= MOD;
    }  
    ll nin = 1;
    for (int i = 0; i < n; i++) {
        nin *= 9;
        nin %= MOD;
    }
    ll no = 1;
    for (int i = 0; i < n; i++) {
        no *= 8;
        no %= MOD;
    }
    cout << (all + no - nin - nin + MOD + MOD) % MOD;
}
 
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    
    solve();
}

Measured memory_bytes: 3636
# -*- coding: utf-8 -*-

(X, Y, A, B, C) = (int(i) for i in input().split())
P = [int(i) for i in input().split()]
Q = [int(i) for i in input().split()]
R = [int(i) for i in input().split()]

# 赤色のリンゴ（P）を美味しい順にX個だけにする
sorted_P = sorted(P, reverse=True)
delicious_P = sorted_P[:X]

# 緑色のリンゴ（Q）を美味しい順にY個だけにする
sorted_Q = sorted(Q, reverse=True)
delicious_Q = sorted_Q[:Y]

# 残ったリンゴと無色のリンゴを美味しい順に並べてX+Y個取る
# つまり赤と緑の残ったリンゴの美味しくない物から順に無色のリンゴに置き換わる
apples = delicious_P + delicious_Q + R
sorted_apples = sorted(apples, reverse=True)
remaining = sorted_apples[:X+Y]
print(sum(remaining))

Measured memory_bytes: 24960
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt(), b = sc.nextInt(), q = sc.nextInt();
		
		TreeSet<Long> t = new TreeSet<Long>(),
				s = new TreeSet<Long>();
		
		for (int i=0; i<a; i++) s.add(sc.nextLong());
		for (int i=0; i<b; i++) t.add(sc.nextLong());
		
		for (int i=0; i<q; i++) {
			long pos = sc.nextLong();
			Long tl = t.floor(pos), tr = t.ceiling(pos), 
					sl = s.floor(pos), sr = s.ceiling(pos);
			if (tl==null) tl = -1L<<60;
			if (tr==null) tr = 1L<<60;
			if (sl==null) sl = -1L<<60;
			if (sr==null) sr = 1L<<60;
			
			Long min = 1L<<60;
			
			min = Math.min(Math.max(pos - tl, pos - sl), Math.max(tr - pos, sr - pos));
			min = Math.min(min, (pos - tl) + (sr - pos) + Math.min((pos - tl), (sr - pos)));
			min = Math.min(min, (tr - pos) + (pos - sl) + Math.min((tr - pos), (pos - sl)));
			
			
			System.out.println(min);
			
		}
	}
}

Measured memory_bytes: 109476
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <climits>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  int res = 0;
  for(int i = 0; i < n; i++){
    ll x;
    cin >> x;
    if(x % 2 == 1)res++;
  }
  if(res % 2 == 1)cout << "NO" << endl;
  else cout << "YES" << endl;
	return 0;
}


Measured memory_bytes: 256
a, b = [int(x) for x in input().split()]
s = input()
pre, aft = s[:a], s[a+1:]
h = s[a]

ans = 'Yes'

if '-' in pre:
    ans = 'No'

if '-' in aft:
    ans = 'No'

if h != '-':
    ans = 'No'

if len(aft) != b:
    ans = 'No'

print(ans)

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		StringBuilder sb = new StringBuilder();
		String in;
		Node[] T = new Node[1];
		while(true){
			in = br.readLine();
			if(in.startsWith("i")) {
				// insert
				Node.insert(T, Integer.parseInt(in.substring(7)));
			}else if(in.startsWith("ex")) {
				// extract
				sb.append(Node.extract(T) + "\n");
			}else{
				// end
				break;
			}
		}
		System.out.print(sb);
	}
}

class Node{
	public int key;
	public Node left;
	public Node right;
	public Node p;
	public Node(int key){
		this.key = key;
	}
	public static void insert(Node[] T, int key){
		Node z = new Node(key);
		Node y = null;
		Node x = T[0];
		while(x != null){
			y = x;
			if(z.key < x.key){
				x = x.left;
			}else{
				x = x.right;
			}
		}
		z.p = y;
		
		if(y == null){
			T[0] = z;
		}else if(z.key < y.key){
			y.left = z;
		}else{
			y.right = z;
		}
	}
	public static int extract(Node[] T){
		Node z = T[0];
		Node y = null;
		while(z != null){
			y = z;
			z = z.right;
		}
		z = y;
		
		if(z.left == null || z.right == null){
			// case 1, 2
			Node c = null;
			if(z.left != null){
				c = z.left;
				c.p = z.p;
			}else if(z.right != null){
				c = z.right;
				c.p = z.p;
			}
			if(z.p != null) {
				if(z.p.left == z){
					z.p.left = c;
				}else{
					z.p.right = c;
				}
			}else{
				T[0] = c;
			}
		}else{
			// case 3
			Node n = z.right;
			while(n.left != null){
				n = n.left;
			}
			z.key = n.key;
			if(n.right == null){
				// case 1
				if(n.p.left == n){
					n.p.left = null;
				}else{
					n.p.right = null;
				}
			}else{
				// case 2
				n.p.left = n.right;
				n.right.p = n.p;
			}
		}
		return z.key;
	}
}

Measured memory_bytes: 162252
#include <stdio.h>

void swap(int *x, int *y){
    int tmp;
    tmp = *x;
    *x = *y;
    *y = tmp;
}

int gcd(int x, int y){
    int r;
    if(x < y)
        swap(&x, &y);
    while(y > 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
}

int main(void){
    int x;
    int y;
    scanf("%d%d", &x, &y);
    printf("%d\n", gcd(x, y));
    return 0;
}


Measured memory_bytes: 2108
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int w = sc.nextInt();
		String picture = "";
		for (int i = 0; i < h; i++) {
			String text = sc.next();
			picture += (text + "\r\n" + text + "\r\n");
		}
		System.out.println(picture);
		
	}
}


Measured memory_bytes: 41400
#include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <unordered_map>
#define Debug 0
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 998244353;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

//最大公約数
template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

//最小公倍数
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

//入出力高速化(非同期化)
void fast_input() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int solve(int n, int a, int b, int c, int x) {
    vector<int> y(n);
    for (int i = 0; i < n; i++) {
        cin >> y[i];
    }
    int ret = -1;
    for (int i = 0, j = 0; i < n && j < 10001; j++) {
        if (x == y[i]) i++;
        x = (a*x+b)%c;
        if (i == n) ret = j; 
    }
    return ret;
}

int main(){
    int n, a, b, c, x;
    vector<int> ans;
    while (1) {
        cin >> n >> a >> b >> c >> x;
        if (!n && !a && !b && !c && !x) break;
        ans.push_back(solve(n, a, b, c, x));
    }
    for (auto &i: ans) {
        cout << i << endl;
    }
}





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

int main(){
    string s;
    cin>>s;
    if(s[1]!=s[0]){
        if(s[2]!=s[0]){
            if(s[3]==s[0]&&s[2]==s[1]){printf("Yes");}
            else{printf("No");}
        }
        else{
            if(s[1]==s[3]){printf("Yes");}
            else{printf("No");}
        }
    }
    else if(s[2]!=s[0]){
        if(s[2]==s[3]){printf("Yes");}
        else{printf("No");}
    }
    else{printf("No");}
    printf("\n");

}

Measured memory_bytes: 3692
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	String[] xs = scan.nextLine().split(" ");
	String[] ys = scan.nextLine().split(" ");
	int[] x = new int[n];
	int[] y = new int[n];
	for (int i = 0; i < n; i++) {
	    x[i] = Integer.parseInt(xs[i]);
	    y[i] = Integer.parseInt(ys[i]);
	}
	System.out.println(manhattanDistance(x, y));
	System.out.println(minkowskiDistance(x, y, 2));
	System.out.println(minkowskiDistance(x, y, 3));
	System.out.println(chebyshevDistance(x, y));
    }
    public static double absoluteValue(int a, int b){
	if (a < b) {
	    return (double)b - a;
	} else {
	    return (double)a - b;
	}
    }
    public static double manhattanDistance(int[] x, int[] y){
	double sum = 0;
	for (int i = 0; i < x.length; i++) {
	    sum += absoluteValue(x[i], y[i]);
	}
	return (double)sum;
    }
    public static double minkowskiDistance(int[] x, int[] y, int p){
	double sum = 0;
	for (int i = 0; i < x.length; i++) {
	    sum += Math.pow(absoluteValue(x[i], y[i]), p);
	}
	if (p == 2) {
	    return Math.sqrt(sum);
	} else if (p == 3) {
	    return Math.cbrt(sum);
	}
	return 0;
    }
    public static double chebyshevDistance(int[] x, int[] y){
	double max = 0;
	for (int i = 0; i < x.length; i++) {
	    double distance = absoluteValue(x[i], y[i]);
	    if (max < distance) {
		max = distance;
	    }
	}
	return max;
    }
}

Measured memory_bytes: 26408
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#include <map>
#include <climits>
#include <vector>
#include <set>
#include <string>
#include <numeric>

#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
//#define int long long
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<pair<int, int>> vii;
const int N = 2 * (1e5 + 1);
const int INF = 1e9 + 5;
const long long MOD = 1e9 + 7;

int32_t main() {
    FAST_IO;
    int a, b;
    cin >> a >> b;
    if (a == b == 1 || a == b) cout << "Draw";
    else if (a == 1) cout << "Alice";
    else if (b == 1) cout << "Bob";
    else if (a > b) cout << "Alice";
    else if (b > a) cout << "Bob";

    return 0;
}


Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define fore(x, c) for(auto &&x : c)
#define rep(i, a, n) for(int i = a, i##len = (int)(n); i < i##len; ++i)
#define rrep(i, a, n) for(int i = (int)(n - 1); i >= a; --i)
#define sz(c) ((int)c.size())
#define contains(c, x) (c.find(x) != end(c))
#define inseg(l, x, r) ((l) <= (x) && (x) < (r))
#define dump(...)
#define pb push_back
#define eb emplace_back
#define _ 0
const signed INF_ = 1001001001; const long long INF = 1001001001001001001LL;
const int DX[9] = {0,1,0,-1,1,1,-1,-1,0}, DY[9] = {-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
  is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a, const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a, const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap = priority_queue<T, deque<T>, greater<T>>;
struct before_main_function {
  before_main_function() {
      cin.tie(nullptr); ios::sync_with_stdio(0);
      cout << setprecision(15) << fixed;
  }
} before_main_function;
// clang-format on
//------------------8<------------------------------------8<--------------------

// 1-indexed
struct BIT {
  int size;
  int pow2_less;
  vector<int> data;
  BIT(int n) : size(n + 1), data(n + 1, 0) {
    pow2_less = 1;
    while ((pow2_less << 1) <= size) pow2_less <<= 1;
  }
  void add(int i, int x) {
    while (i < size) {
      data[i] += x;
      i += i & -i;
    }
  }
  int sum(int i) {
    int ret = 0;
    while (i > 0) {
      ret += data[i];
      i -= i & -i;
    }
    return ret;
  }
  // sum(x) >= w となる最小のxを返す
  int lower_bound(int w) {
    if (w <= 0) return 0;
    int x = 0;
    for (int k = pow2_less; k > 0; k >>= 1) {
      if (x + k < size && data[x + k] < w) {
        w -= data[x + k];
        x += k;
      }
    }
    return x + 1;
  }
};
signed main() {
  int N;
  cin >> N;
  vi A(N);
  cin >> A;
  int ans = 0;
  BIT bit(N);
  rep(i, 0, N) {
    if (!bit.sum(A[i])) {
      ans++;
    }
    bit.add(A[i], 1);
  }
  cout << ans << endl;
  return (0 ^ _ ^ 0);
}



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

int main(){
  int n;
  cin >>  n;
  int count =0;
  for(int i=1;i<=n;i++){
    if(i%2==1){
      int yakusuu=0;
      for(int j=1;j<=i;j++){
        if(i%j==0){
          yakusuu++;
        }
      }
      if(yakusuu==8){
        count++;
      }
    }
  }
  cout << count << endl;
        
  return 0;
}

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

int main(){
    int N,K;
    cin>>N>>K;
    vector<double> lst(N,0);
    rep(i,N){
        double tmp;
        cin>>tmp;
        tmp = (tmp+1)/2;
        lst[i] = tmp;
    }
    vector<double> lst2(N+1,0);
    lst2[0] = 0;
    rep(i,N){
        lst2[i+1] = lst2[i] + lst[i];
    }
    double ans = 0;
    rep(j,N-K+1){
        double tmp = lst2[j+K]-lst2[j];
        ans = max(ans,tmp);
    }
    printf("%lf\n", ans);
    return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main()
{
    ll n; cin >> n;
    ll s = 0;
    for(ll i = 1; i <= n; i++)
    {
        for(ll j = 1; j <= n; j++)
        {
            for(ll k = 1; k <= n; k++)
            {
                s += gcd(i, gcd(j,k));
                //s += gcd(j,gcd(k,i));
                //s += gcd(k,gcd(i,j));

            }
        }
    }
    cout << s;
}


Measured memory_bytes: 3636
/*
 * atcoder/abc163/a.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

int N;
void solve() {
  cin >> N;
  cout << 2 * M_PI * (double)N << endl;
}
int main() {
  cout.precision(15);
  cout << fixed;

  solve();

  return 0;
}


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

int main(){
    int A,B,C;
    cin >> A >> B >> C;
    if(A > B && A > C) cout << "A" << endl;
    else if(B > A && B > C) cout << "B" << endl;
    else cout << "C" << endl;
}


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

typedef  long long ll;
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;}

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep2(i, begin_i, end_i) for (int i = (int)begin_i; i < (int)end_i; i++)

long long INF = 1LL<<60;
long long dp[100010];
int h[100010];
int n;
int main(){
    cin>>n;
    vector<int> a(n);
    rep(i,n)cin>>a.at(i);
    vector<int> b=a;
    sort(b.begin(),b.end(),greater<int>());
    int largest=b.at(0);
    int second=b.at(1);
    rep(i,n){
        if(a.at(i)==largest)cout<<second<<endl;
        else cout<<largest<<endl;
    }
    return 0;
}




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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(15);

  int n, a, b;
  string s;
  cin >> n >> a >> b >> s;

  int cnt = 0, bcnt = 1;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == 'c') {
      cout << "No" << '\n';
    } else if (s[i] == 'a') {
      if (cnt < a + b) {
        cout << "Yes" << '\n';
        ++cnt;
      } else {
        cout << "No" << '\n';
      }
    } else {
      if (cnt < a + b && bcnt <= b) {
        cout << "Yes" << '\n';
        ++cnt;
      } else {
        cout << "No" << '\n';
      }
      ++bcnt;
    }
  }

  return 0;
}


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

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;


#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1};


int main()
{
    ll n,k;
    cin>>n>>k;
    vector<ll> a(n);
    for (int i = 0; i < n; i++)
    {
        cin>>a[i];
    }
    for (int i = 0; i < k; i++)
    {
        vector<ll> imos(n+1);
        bool all0=true;
        bool alln=true;
        for (int j = 0; j < n; j++)
        {
            ll l=max(0LL,j-a[j]);
            ll r=min(n,j+a[j]+1);
            imos[l]++;
            imos[r]--;
        }
        int cnt=0;
        for (int j = 0; j < n; j++)
        {
            cnt+=imos[j];
            a[j]=cnt;
            if(cnt!=0) all0=false;
            if(cnt!=n) alln=false;
        }
        if(all0 || alln)
        {
            break;
        }
    }
    
    for (int i = 0; i < n; i++)
    {
        cout<<a[i];
        if(i==n-1)
        {
            cout<<endl;
        }
        else
        {
            cout<<" ";
        }
        
    }
    
    
    return 0;
}

Measured memory_bytes: 6436
#include <iostream>
#include <fstream>
using namespace std;
int a[200005];
int n,i,ans,j,s;
int main()
{
    //freopen("data.in","r",stdin);
    ios_base::sync_with_stdio(false);
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=1;i<=n;i++)
    {
        s=i;j=i;
        while(a[i]==a[s])
            s++;
        if(a[i]<a[s])
        {
            j=s;
            while(j<=n&&a[j-1]<=a[j])
                j++;
        }
        else
        {
             j=s;
             while(j<=n&&a[j-1]>=a[j])
                j++;
        }
        ans++;
        i=j-1;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 640
import java.math.BigDecimal;
import java.util.*;
public class Main {
	public static void main(String[] args){
      	
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		
		int arr[] = new int[N];
		for (int i = 0; i < K; i++) {
			int d = sc.nextInt();
			for (int j = 0; j < d; j++) {
				arr[sc.nextInt()-1]++;
			}
		}
		int cnt = 0;
		for (int j = 0; j < arr.length; j++) {
			if (arr[j]==0) {
				cnt++;
			}
		}
		System.out.println(cnt);
		sc.close();
    }
		
		
}


Measured memory_bytes: 37536
/**
 *    author        : Saurav Paul 
 *    created       : August 29, 2020 6:43 PM
 *    Problem Name  : E - Coprime
 *    Problem Limit : 2000 ms , 1024 MB
 *    Problem Url   : https://atcoder.jp/contests/abc177/tasks/abc177_e
 *    @genarated by : ai-virtual-assistant
**/

#include<bits/stdc++.h>
using namespace std;
using ll = long long int ;
vector<int>primelist;
const int nax = 1e6 + 90 ;
int mark[nax];
void sieve()
{
    int n = nax - 10 ;
    int i,j,limit=sqrt(n*1.)+2;
    primelist.push_back(2);
    //take 1 for not prime and 0 for prime
    mark[1]=1;
    //almost all even are,not prime
    for(i=4; i<=n; i+=2)
    {
        mark[i]=1;
    }
    //2 is prime
    mark[1]=2;
    //run loop for only odds
    for(i=3; i<=n; i+=2)
        //if not prime, no need to do multiple cutting
        if(!mark[i])
        {
            //i is prime
            primelist.push_back(i);

            //if we don,t do it, following
            //i*i may overflow
            if(i<=limit)
            {
                //loop though all odd multiples of i
                //greater than i*i
                for(j=i*i; j<=n; j+=i*2)
                {
                    //mark j not prime
                    mark[j]=1;
                }
            }
        }


}
class TC{

    int N, mx  ;
    vector<int> v ;

    public :

    bool check(){
        bool ok = true ;
        sort(v.begin(),v.end()) ;

        vector<int> pos(mx+10,0) ;

        for(int i = 0 ; i < N ; i++){
            int num = v[i] ;
            pos[num] ++;
        }

        for(auto p : primelist){
            int cnt = 0 ;
            for(int i = p ; i <= mx ; i += p){
                cnt += pos[i] ;
            }
            if(cnt > 1) return false ;
        }
        return true ;
    }

    void solve(){
        cin >> N ;
        int GCD = 0 ;
        for(int i = 0 ; i< N; i++){
            int x; cin >> x;
            v.push_back(x) ;
            mx = max(x,mx) ;

            GCD = __gcd(x,GCD) ;
        }

        string ans = "x" ;
        if(GCD == 1){
            if(check()){
                ans = "pairwise coprime" ;
            }
            else{
                ans = "setwise coprime" ;
            }
        }
        else{
            ans = "not coprime" ;
        }
        cout << ans << endl ;

    }

};

int main(){
    ios_base::sync_with_stdio(false);
    sieve() ;
    int testcases = 1;
    for(int i = 1 ; i <= testcases ; i ++){
        TC tc;
        tc.solve() ;
    }

    return 0 ;
}


Measured memory_bytes: 15220
N = int(input())
A = list(map(int, input().split()))
#A = [888881 for i in range(10**6)]
M = max(A)


#高速素因数分解
#前処理：その数にある最小の素因数→エラトステネスの篩で最初におとすもの
P = [1 for i in range(M+1)]
for i in range(2, M+1):
    if P[i] == 1:
        for j in range(i, M+1, i):
            if P[j] == 1:
                P[j] = i
dic = {}
for a in A:
  t_dic = {}
  x = a
  while x > 1:
    if P[x] in t_dic:
      t_dic[ P[x] ] += 1
    else:
      t_dic[ P[x] ] = 1    
    x //= P[x]
  for k in t_dic.keys():
    if k in dic:
      dic[k] += 1
    else:
      dic[k] = 1
#print(dic)
c = 0
for v in dic.values():
  c = max(c, v)

if c == len(A):
  print("not coprime")
elif c < 2:
  print("pairwise coprime")
else:
  print("setwise coprime")

Measured memory_bytes: 208840
#include <iostream>
#include<string>
using namespace std;
int main(void){
    // Your code here!
    string first,second;
    
    cin>>first>>second;
    
    string conv = first.substr(2, 1)+first.substr(1,1)+first.substr(0,1);
    
    if(second==conv) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}


Measured memory_bytes: 256
N , A , B = map(int, input().split())
C = A + B
ans = 0
D = N // C

if D >= 1:
    ans = A * D
    if N % C <= A:
        ans = ans + N%C
    elif N % C > A:
        ans = ans + A

elif D < 1:
    if N >= A:
        ans = A
    else:
        ans = N
print(ans)
    


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define int long long
using namespace std;

int n, a[300005];
const int mod = 1e9+7;

signed main(){
  
  cin>>n;
  
  for(int i=0;i<n;i++) cin>>a[i];
  
  int ans = 0;
  
  for(int i=0;i<61;i++){
    
    int cnt = 0;
    
    for(int j=0;j<n;j++){
      cnt += a[j] >> i & 1;
    }
    
    int A = cnt * ( n - cnt ) % mod;
    int B = ( 1LL << i ) % mod;
    
    ans += A * B % mod;
    ans %= mod;
    
  }

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


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP2(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(v) (v).begin(),(v).end()
#define INF 2e9
typedef long long ll;

int main()
{
  int n;
  cin>>n;
  vector<int> bi(n);
  REP(i,n){
    int bit=0;
    REP(j,10){
      int temp;
      cin>>temp;
      bit+=pow(2,9-j)*temp;
    }
    bi[i]=bit;
  }
  vector<vector<int>> p(n,vector<int>(11));
  REP(i,n){
    REP(j,11){
      cin>>p[i][j];
    }
  }

  int ans=-INF;
  REP(i,1<<10){
    if(i==0) continue;
    int res=0;
    REP(j,n){
      res+=p[j][__builtin_popcount(bi[j]&i)];
    }
    ans=max(ans,res);
  }
  cout<<ans<<endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int n, x, Max;

int main()
{
  cin>>n;
  Max = 0;
  bool flag = true;
  for(int i=0;i<n;i++){
    cin>>x;
    if(Max - 1 > x){
      flag = false;
    }
    else {
      Max = max(Max, x);
    }
  }
  if(flag == true) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

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

const int mod = 1e9 + 7;

int main()
{
    int N, M;
    cin >> N >> M;
    vector<vector<int>> dp(N + 1, vector<int>(N + 1));
    dp[1][1] = 1;
    for(int i = 0;i < M;i++){
        vector<vector<int>> tmp(N + 1, vector<int>(N + 1));
        for(int i = 1;i <= N;i++){
            for(int j = 1;j <= N;j++){
                if(i + 1 <= N) (tmp[i + 1][j] += 1LL * dp[i][j] * (N - i) % mod) %= mod;
                (tmp[i][j] += 1LL * dp[i][j] * (i - j) % mod) %= mod;
                (tmp[i][i] += 1LL * dp[i][j] * j % mod) %= mod;
            }
        }
        dp = move(tmp);
    }
    cout << dp[N][N] << endl;
    return 0;
}


Measured memory_bytes: 1028
#!/usr/bin/python3

from functools import reduce
from operator import add
import sys


def main():
    N, K = map(int, input().split(' '))
    sys.setrecursionlimit(N + 50)

    C = 1
    for i in range(K, N + 1):
        C += (N * (N + 1) // 2 - (N - i) * (N - i + 1) // 2) \
            - ((i * (i - 1)) // 2) \
            + 1
    print(C % 1000000007)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9432
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
const int max_n = 100000;
const int max_m = 100000;

ll parent[max_n];
ll Rank[max_n];
ll numberofgroup[max_n];

void init(ll n){
    REP(i,n){
        parent[i] = i;
        Rank[i] = 0;
        numberofgroup[i] = 1;
    }
}

ll find(ll x){
    if(x == parent[x]) return x;
    else{
        return parent[x] = find(parent[x]);
    }
}

void unite(ll x, ll y){
    x = find(x);
    y = find(y);
    if(x == y) return;
    
    if(Rank[x] < Rank[y]){
        parent[x] = y;
        numberofgroup[y] += numberofgroup[x];
    }
    else{
        parent[y] = x;
        if(Rank[x] == Rank[y]) Rank[x]++;
        numberofgroup[x] += numberofgroup[y];
    }
}

bool same(ll x,ll y){
    return find(x) == find(y);
}


ll N,M;
ll A[max_n], B[max_m];
ll ans[max_m+1];
int main(){
    cin >> N >> M;
    REP(i,M){
        cin >> A[i] >> B[i];
    }
    ans[M] = N * (N-1) / 2;
    init(N);
    REPR(i,M-1){
        ll a = A[i]-1;
        ll b = B[i]-1;
        if(same(a,b)){
            ans[i] = ans[i+1];
            unite(a,b);
        }
        else{
            ans[i] = ans[i+1] - numberofgroup[find(a)] * numberofgroup[find(b)];
            unite(a,b);
        }
    }
    REP(i,M){
        cout << ans[i+1] << endl;
    }
}

Measured memory_bytes: 6016
class Dice:
    #f[]はUSEWNDの順，添字はU:0,S:1,E:2,W:3,N:4,D:5
    def __init__(self,l):
        self.f=l
        
    def __str__(self):
        l=self.f
        s=f'[U:{l[0]},S:{l[1]},E:{l[2]},W:{l[3]},N:{l[4]},D:{l[5]}]'
        return(s)
       
    def roll(self,c):
        if c=='N':
            ni=[1,5,2,3,0,4]
        elif c=='S':
            ni=[4,0,2,3,5,1]
        elif c=='E':
            ni=[3,1,0,5,4,2]
        elif c=='W':
            ni=[2,1,5,0,4,3]
        self.f=[self.f[j] for j in ni]
    
    def rotate(self,r):
        if r==+1: #Uから見て反時計(西)回り
            ni=[0,3,1,4,2,5]
        elif r==-1: #Uから見て時計(東)周り
            ni=[0,2,4,1,3,5]
        self.f=[self.f[j] for j in ni]

    def patterns(self):
        fs=[]
        for i in range(6):
            if i%2==0:
                self.roll('N')
            else:
                self.roll('E')
            for j in range(4):
                self.rotate(+1)
                fs.append(self.f)
        return fs
        
    def lookEast(self,l):
        for f in self.patterns():
            if f[0]==l[0] and f[1]==l[1]:
                return f[2]
    
    def equals(self,d):
        for f in self.patterns():
            if f==d.f:
                return True
        return False

print('Yes' if Dice(list(map(int,input().split()))).equals(Dice(list(map(int,input().split())))) else 'No')


Measured memory_bytes: 5628
#include <iostream>

inline unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap){
  unsigned count = 0;
  for(unsigned i = gap; i < n; i++){
    unsigned v = a[i];
    int j = i - gap;
    while(j >= 0 && a[j] > v){
      a[j+gap] = a[j];
      j -= gap;
      count++;
    }
    a[j+gap] = v;
  }
  return count;
}

inline void shell_sort(unsigned a[], unsigned n){
  const unsigned gaps[] = {1,8,23,77,281,1073,4193,16577,65921,262913,1050113};
  // generated from pow(4,i)+3*pow(2,i-1)+1 (prefixed with 1)

  unsigned gap_num = 0, count = 0;
  while(gaps[gap_num+1] < n) gap_num++;

  for(int i = gap_num; i >= 0; i--) count += insertion_sort(a,n,gaps[i]);

  std::cout << (gap_num+1) << '\n';

  for(int i = gap_num; i; i--) std::cout << gaps[i] << ' ';
  std::cout << gaps[0] << '\n';

  std::cout << count << '\n';
}

int main(){
  std::ios::sync_with_stdio(false);
  unsigned n;
  std::cin >> n;
  unsigned a[n];
  for(unsigned i = 0; i < n; i++) std::cin >> a[i];
  shell_sort(a,n);
  for(unsigned i = 0; i < n; i++) std::cout << a[i] << '\n';
}

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

#define fi first
#define se second
#define mp make_pair
#define sz(v) (int) v.size()
#define all(v) v.begin(), v.end()

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	ll ans = 0;
	for (int i = 1; i <= n; ++i) {
		if (i % 3 && i % 5) ans += i;
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 3620
/*
 * atcoder/abc123/c.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
#include <queue>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

ll N;
ll a;
void solve() {
  cin >> N;
  ll min_ = 100000000000000000;
  loop(n,0,5) {
    cin >> a; chmin(min_, a);
  }
  cout << (ll)ceil(N/(double)min_)+4 << endl;

}
int main() {
  // cout.precision(15);
  // cout << fixed << double

  solve();

  return 0;
}


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

int solve(int x,int y)
{
	if (x%y==0) return x/y;
	int k=x/y+1;
	return solve(x-max(1,x%y/k)*k,y);
}
int n,x,y,ans;
int main()
{
	scanf("%d",&n);
	while (n--)
	{
		scanf("%d%d",&x,&y),ans^=solve(x,y);
	}
	return printf("%s",ans?"Takahashi":"Aoki"),0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
typedef long long ll;

using namespace std;

// init {{{
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


const int NM = 101001;//ここを問題の制約を見ながらいじる．配列の確保に使う．
int A[NM];//あまり褒められたことではないが関数の外側に配列を確保すると怒られにくい．

// Main program
void solve(){
  string S;
  cin >> S ;
  int len = S.length();
  
  int ans=0;
  for(int i = 0;i <len/2; i++){
    if(S.at(i) != S.at(len - i-1)){
      ans++;
    }
  }
  cout << ans;
}

int main() {
    solve();
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 300000

int main(){
	vector<int> a[N];
	int n, m, k;
	int x, y, z;
	bool v;
	scanf("%d %d %d", &n, &m, &k);
	f(i, k){
		scanf("%d %d", &x, &y);
		x--;
		y--;
		a[x].push_back(y);
	}
	f(i, n)sort(a[i].begin(), a[i].end());

	k = 0;
	for(int i=1;i<n;i++){
      if(a[i].size()>0){
		if (a[i][0] <= k){
			printf("%d\n", i);

			return 0;
		}
      }
		v = false;
		f(j, a[i].size()){
			if (a[i][j] == k + 1)v = true;
		}
		if (!v)k++;
	}
	printf("%d\n", n);

	return 0;
}



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

//variable
// none

//structure
struct _dice
{
    int num[6] ;
};

//type definition
typedef struct _dice dice_t ;

//structure declaration
dice_t dice1 ;
dice_t dice2 ;

//function
void vertical()
{
    int cmp = dice2.num[0] ;
    dice2.num[0] = dice2.num[4] ;
    dice2.num[4] = dice2.num[5] ;
    dice2.num[5] = dice2.num[1] ;
    dice2.num[1] = cmp ;
}

void horizontal()
{
    int cmp = dice2.num[1] ;
    dice2.num[1] = dice2.num[2] ;
    dice2.num[2] = dice2.num[4] ;
    dice2.num[4] = dice2.num[3] ;
    dice2.num[3] = cmp ;
}

//main
int main()
{
    for (int i = 0 ;i < 6 ;i++ )
    {
        cin >> dice1.num[i] ;
    }
    for (int i = 0 ;i < 6 ;i++ )
    {
        cin >> dice2.num[i] ;
    }

    for (int i = 0 ;i < 5 ;i++ )
    {
        for (int j = 0 ;j < 5 ;j++ )
        {
            if ( dice1.num[0] == dice2.num[0] ) break ;
            vertical() ;
        }
        for (int j = 0 ;j < 5 ;j++ )
        {
            if ( dice1.num[1] == dice2.num[1] ) break ;
            horizontal() ;
        }
    }

    if ( dice1.num[0] == dice2.num[0] && dice1.num[1] == dice2.num[1] && dice1.num[2] == dice2.num[2] )
    {
        cout << "Yes" << endl ;
    }
    else cout << "No" << endl ;

    return 0 ;
}

Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define str string
#define vi vector<int>
#define vd vector<double>
#define vs vector<string>
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m-1);i>=(int)(n);i--)
#define rev(i, n) revi(i, n, 0)
#define each(i, n) for(auto&& i: n)
#define pb push_back
#define mp make_pair
#define sz(v) ((int)(v).size()) 
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin() , (v).rend()
#define dump(x) cerr << #x << "=" << x <<endl
#define gcd __gcd
#define popcount __builtin_popcountll
int lcm(int a, int b){return a / gcd(a, b) * b;}
const int INF = 1e18;
const int MOD = 1e9 + 7;
const double EPS = 1e-15;
const double PI = acos(-1);

void solve() {
	str ans = "No";
	set<int> s;
	rep(i, 3) {
		int a; cin >> a;
		s.insert(a);
	}
	if (sz(s) == 2) ans = "Yes";
	cout << ans << endl;
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	solve();
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
#define fr first
#define sc scanf
#define pf printf
#define se second
#define sq(x) x * x
#define ll long long
#define pb push_back
#define mk make_pair
#define ld long double
#define pr pair<int,int>
#define sz(s) int(s.size())
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll INF = 1e9;
const ll N = 2e2+7;
const ll mod = 1e9 + 7;
const long double eps = 1E-7;
ll a, b, n , cnt ,mx,ans,c;
ll used[ N ];
ld x , y;
string s;
int main()
{
        TIME;
        cin >> x >> y;
        cout << fixed<<setprecision(10)<<x/y;
}


/* MADE BY
//________________________________________________________
//________________________________________________________ //
                                                           //
// ██╗   ██╗     ██████╗     ███████╗    ██╗    ███╗   ██╗ //
// ╚██╗ ██╔╝    ██╔═══██╗    ██╔════╝    ██║    ████╗  ██║ //
//  ╚████╔╝     ██║   ██║    ███████╗    ██║    ██╔██╗ ██║ //
//   ╚██╔╝      ██║   ██║    ╚════██║    ██║    ██║╚██╗██║ //
//    ██║       ╚██████╔╝    ███████║    ██║    ██║ ╚████║ //
//    ╚═╝        ╚═════╝     ╚══════╝    ╚═╝    ╚═╝  ╚═══╝ //
//________________________________________________________ //
//________________________________________________________ */


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

using namespace std;

/*
1.nを取得して山を作る

2.シャッフルする回数を取得
3.シャッフする
 3-1.静的なベクターをバッファとしてシャッフルし、スワップする
 3-2.リフルとカットは別関数で
*/

void riffle(vector<int>& yama, vector<int>& temp) {
	const int n = yama.size() / 2;
	for (int i = 0; i < n; ++i) {
		temp[i * 2] = yama[i];
		temp[i * 2 + 1] = yama[n + i];
	}
	swap(yama, temp);
}

void kattar(vector<int>& yama, vector<int>& temp, int k) {
	// 山の上にあるものを下の位置にコピー
	copy(yama.begin(), yama.begin() + k, temp.end() - k);
	// 山ノ下にあるものを上の位置にコピー
	copy(yama.begin() + k, yama.end(), temp.begin());
	swap(yama, temp);
}

void shuffle(vector<int>& yama, int k) {
	static vector<int> temp(yama.size());
	if (k == 0) {
		riffle(yama, temp);
	}
	else {
		kattar(yama, temp, k);
	}
}

int main() {
	int n;
	cin >> n;

	// 山を構築
	vector<int> yama(2 * n);
	for (int i = 0; i < yama.size(); ++i) {
		yama[i] = i + 1;
	}

	// シャッフルする
	int shuffle_n;
	cin >> shuffle_n;

	for (int i = 0; i < shuffle_n; ++i) {
		int k;
		cin >> k;
		shuffle(yama, k);
	}

	for (auto a : yama) {
		cout << a << endl;
	}
}

Measured memory_bytes: 1220
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const double PI = acos(-1);  

int n, m, q;
vector<ll> a, b, c, d;
vector<ll> A;
ll ans=0;

void dfs(int depth, int num){
  if(depth==n){
    ll sum=0;
    for(int i=0; i<q; i++)
      if(A[b[i]-1]-A[a[i]-1]==c[i]) sum += d[i];
    ans = max(ans, sum); return;
  }
  for(int i=num; i<=m; i++){
    A[depth] = i;
    dfs(depth+1, i);
  }
}


int main(){
  cin >> n >> m >> q;
  a = b = c = d = vector<ll>(q);
  A.resize(n);
  for(int i=0; i<q; i++)
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  dfs(0, 1);
  cout << ans << endl;
}


Measured memory_bytes: 3652