akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    
    int N;
    cin >> N;
    int A,B;
    cin >> A >> B;
    
    bool turn = true;
    while( abs( A-B) > 1 ) {
        
        turn ? A++ : B--;
        
        turn = !turn;
    }
    
    cout << ( turn ? "Borys" : "Alice" ) << endl;
    
    
    
    return 0;
}

Measured memory_bytes: 256
//shara's here
//SPEEEEEEEEEED IS KEEEEEEEEEEY
//REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
#include <bits/stdc++.h>
using namespace std;
typedef string s;
typedef long long ll;
typedef long double ld;
const ll INF = 1e18 + 10;
const ll MINF = -(1e18 + 10);
const ll MOD = 1e9 + 7;
#if defined(BANYANYA)
#include "/home/xsharawi/Desktop/cpp/debug.hpp"
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define pb push_back
#define all(a) a.begin(),a.end()
#define vl vector<ll>
#define vll vector<vector<ll> >
#define ins insert
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)

ll cnt( ll x ){
	s ss = to_string(x) ;
	ll n = (ll) ss.size() , ans = 0;
	for( ll i = 0 ;i < n; i++ ){
	ans+=(ss[i]-'0');	
	}
	return ans;
	}

int main(){
	ll n , a , b , sum = 0;
	cin >> n >> a >> b;
	for( ll i = 1; i <= n; i++ ){
	if(cnt(i)>=a&&cnt(i)<=b)sum+=i;
	}
	cout << sum << endl;
	
	
	





return 0;}
/*
███████████████████████████████████████████████████
███████████████████████████████████████████████████
██████████████████████████████████▀████████████████
██████████████████████████████████░▀███████████████
██████████████████████████████▌███░░░▀▀████████████
██▀████████████████████▐██████░▐██░░░░░░▀▀█████████
██░████████████████████▐█████▌░██▌▄░░░░▄▄░▄████▀███
█▌░███████████████████▀░█████░░░█░░░▄████░░███▀▐███
█▌░▐██████████████████░░████▌░░░▀░░▀███▀▀░▐███▄████
██░▀██████████████▌▐█▐▄▄████▌░░░░░░░░░░░░░▌████████
███░███████████████▀░▄▄██▀█▐░░░░░░░░░░░░░░▐████████
███▄░██████████████▄░░░░░░▀▀▀░░░░░░░░░░░░░█▐███████
████▄░██████████████████▄▄▄▄▄▄▐▄░░░░░░░░░░░████████
█████▄█████████████████▀▀▀▀▀▀░░░░░░░░░░░░░░████████
████████████████████████▄░░░░░░░░░░░░░░░▄░░████████
██████████████████████████▄▄▄░░░░░░░░░▄█░▄█████████
████████████████████████████████▄░░░░██▄███▀░░▀████
█████████████████████████████▀█████▄███▀▀▀░░▄▄░████
████████████████████████████▀░░▀░░▀▀░░░░▄▄▄██▀░░▀▀█
███████████████████████████▌░░░░░░░░░░░███████░░░▄█
███████████████▄░▀████████▀░░░░░░▀░░░░███████▌░░░██
███▄▄████████████▄░▀██████▄░░░░░█░░░░████████░░░▀▀
░▀█████████████████▄░▀█████░░░░██░░░░▀██████░░░░░▄█
▐█▄▀█████████████████▄░▀████░░░██▌░░░▐████▀░░░░▄███
▐███▄▀▀█████████████████▄░▀▀░░░░▀██▌▄█▀▀░░░▄▄██████
▀▀▀▀▀░░░▀▀▀▀▀░░░▀▀▀▀▀▀▀▀▀▀▀░░░░░░░▀▀░░░░░░▀▀▀▀▀▀▀▀▀
*/


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define MOD 1000000007
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define ALL(v) v.begin(), v.end()
typedef long long ll;


int main(){

int a,b;
cin >> a >> b;

if(a+b<24)cout << a+b << endl;
else cout << a+b-24 << endl;





return 0;

}




Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<iomanip>
#include<stack>
#include<string.h>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define sz(a) (int)a.size()
using namespace std;

int main() {
	int n;
	cin >> n;
	map<int, int> mp;
	for (int x = 1; x <= 100; x++) {
		for (int y = 1; y <= 100; y++) {
			for (int z = 1; z <= 100; z++) {
				mp[x * x + y * y + z * z + x * y + y * z + z * x]++;
			}
		}
	}
	rep(i, n) cout << mp[i + 1] << endl;
}

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

int main(){
    int a,b;
    cin >> a >> b;
    cout << 6-a-b << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repn(i,n) for(int i = 0; i <= (int)(n); i++)
#define srep(i,l,n) for(int i = l; i < (int)(n); i++)
#define srepn(i,l,n) for(int i = l; i <= (int)(n); i++)
#define drep(i,n) for(int i = (int)(n-1); i >= 0; i--)
#define drepn(i,n) for(int i = (int)(n); i >= 0; i--)
#define size(s) (int)s.size()
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<typename T> inline istream& operator>>(istream &i, vector<T> &v) {rep(j, size(v)) i >> v[j]; return i;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T> T gcd(T a, T b) {if(b==0)return a; else return gcd(b,a%b);}
template<class T> T lcm(T a, T b) {return a/gcd(a,b)*b;}
template<class T = int> using V = vector<T>;
template<class T = int> using VV = vector<V<T>>;
bool isIn(int i, int j, int h, int w) {return i >= 0 && i < h && j >= 0 && j < w;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void err() {cout << -1 << endl;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define ep emplace_back

const int MOD = 1000000007;
const int INF = 1e9;

#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};

const int mx = 6404 * 4;
bool dp[81][81][mx] = {false};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int h, w;
    cin >> h >> w;;
    VV<> a(h, V<>(w)),b(h, V<>(w));
    rep(i, h) rep(j, w) cin >> a[i][j];
    rep(i, h) rep(j, w) cin >> b[i][j];
    VV<> c(h, V<>(w));
    rep(i, h) rep(j, w) c[i][j] = abs(a[i][j] - b[i][j]);

    // dp[i][j][k] := (i, j)についたとき偏りがkになることがあるか
    dp[0][0][c[0][0]] = true;
    rep(i, h) rep(j, w) rep(k, mx) {
        if(i == h-1 && j == w-1) break;
        if(dp[i][j][k]) {
            if(i < h-1) dp[i+1][j][k+c[i+1][j]] = true, dp[i+1][j][abs(k-c[i+1][j])] = true;
            if(j < w-1) dp[i][j+1][k+c[i][j+1]] = true, dp[i][j+1][abs(k-c[i][j+1])] = true;
        }
    }
    int ans = mx;
    rep(i, mx) {
        if(dp[h-1][w-1][i]) chmin(ans, i);
    }
    cout << ans << endl;
}

Measured memory_bytes: 69152
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <cstring>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF 1e18
#define MOD 1e9 + 7

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

int br[112345], bl[112345], bit_n;

int bit_sum(int i, int bit[])
{
    int s = 0;
    while (i > 0)
    {
        s += bit[i];
        i -= i & -i;
    }
    return s;
}

void bit_add(int i, int x, int bit[])
{
    while (i <= bit_n)
    {
        bit[i] += x;
        i += i & -i;
    }
}

int main()
{
    int n, m, l[312345], r[312345];
    P p[312345];

    cin >> n >> m;
    REP(i, n)
    {
        cin >> l[i] >> r[i];
        p[i] = {(r[i] - l[i] + 1), i};
    }

    p[n] = {1e9, 0};

    for (int i = 0; i <= m; i++)
    {
        bl[i] = 0;
        br[i] = 0;
    }

    bit_n = m + 10;

    sort(p, p + n);

    int al = n;

    int pi = 0;

    for (int i = 1; i <= m; i++)
    {
        int res = al;
        for (int j = 0; j <= m; j += i)
        {
            int tmp = n;
            tmp -= bit_sum(j + 1, br);
            tmp -= n - bit_sum(j + 2, bl);

            res += tmp;
        }

        cout << res << endl;

        while (p[pi].first < i + 1)
        {
            bit_add(l[p[pi].second] + 2, 1, bl);
            bit_add(r[p[pi].second] + 2, 1, br);
            pi++;
            al--;
        }
    }

    return 0;
}

Measured memory_bytes: 6528
#pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;
 
#define ll long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

int p[N], b[N], c[N];
 
signed main() {
    IOS;
    #ifdef LOCAL
        freopen("input.txt","r", stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n;  cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> p[i];
    for(int i = 1; i <= n; i++)
        cin >> b[i];
    for(int i = 1; i <= n-1; i++)
        cin >> c[i];
    int ans = b[p[1]];
    for(int i = 2; i <= n; i++){
        ans += b[p[i]];
        if(p[i]-1 == p[i-1])
            ans += c[p[i-1]];
    }   
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,ans=0;
  cin >> n;
  int a[n],b[n];
  for(int g=0;g<n;g++){	
    cin >> a[g];
  }
  for(int i=0;i<n;i++){
    cin >> b[i];
  }
  for(int i=0;i<n;i++){
  	int sum=0;
  	for(int j=0;j<=i;j++){
  		sum+=a[j];
  	}
  	for(int j=i;j<n;j++){
  		sum+=b[j];
  	}
  	ans=max(ans,sum);
  }
  cout << ans << endl;
	return 0;
}


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

int main(int argc, const char * argv[]) {
    int N;
    
    cin >> N;
    vector<int> d(N);
    for (int i = 0; i < N; i++) {
        cin >> d[i];
    }
    sort(d.begin(), d.end());
    d.erase(unique(d.begin(), d.end()), d.end());
    
    cout << d.size() << endl;
    
    return 0;
}

Measured memory_bytes: 256
<?php

$input1 = trim(fgets(STDIN));
$input2 = trim(fgets(STDIN));
$input3 = trim(fgets(STDIN));

$arr = [1 => 0, 2 => 0, 3 => 0, 4 => 0];

list($a, $b) = explode(" ", $input1);
$arr[$a]++;
$arr[$b]++;

list($a, $b) = explode(" ", $input2);
$arr[$a]++;
$arr[$b]++;

list($a, $b) = explode(" ", $input3);
$arr[$a]++;
$arr[$b]++;

$arr2 = [0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0];
foreach ($arr as $key => $value) {
    $arr2[$value]++;
}

if ($arr2[1] == 2 && $arr2[2] == 2) {
    echo "YES";
} else {
    echo "NO";
}


Measured memory_bytes: 3576
s = input()

dic = {}
for i in range(len(s)):
  if s[i] in dic:
    dic[s[i]] += 1
  else:
    dic[s[i]] = 1

if len(dic) == 1:
  if len(s) == 1:
    print('YES')
  else:
    print('NO')

elif len(dic) == 2:
  if len(s) == 2:
    print('YES')
  else:
    print('NO')

else:
  first = 'a'
  second = 'b'
  for k, v in dic.items():
    if  v > dic[first]:
      if k != first:
        second = first
        first = k

    elif v > dic[second]:
      if k != second and k != first:
        second = k


  tmp = first + second
  dic[first] -= 1
  dic[second] -= 1
  ans = 'YES'

  for i in range(1, len(s) - 1):
    if tmp[i-1] == 'a':
      if tmp[i] == 'b':
        if dic['c'] == 0:
          ans = 'NO'
          break
        else:
          dic['c'] -= 1
          tmp += 'c'

      if tmp[i] == 'c':
        if dic['b'] == 0:
          ans = 'NO'
          break
        else:
          dic['b'] -= 1
          tmp += 'b'

    elif tmp[i-1] == 'b':
      if tmp[i] == 'a':
        if dic['c'] == 0:
          ans = 'NO'
          break
        else:
          dic['c'] -= 1
          tmp += 'c'

      if tmp[i] == 'c':
        if dic['a'] == 0:
          ans = 'NO'
          break
        else:
          dic['a'] -= 1
          tmp += 'a'

    elif tmp[i-1] == 'c':
      if tmp[i] == 'a':
        if dic['b'] == 0:
          ans = 'NO'
          break
        else:
          dic['b'] -= 1
          tmp += 'b'

      if tmp[i] == 'b':
        if dic['a'] == 0:
          ans = 'NO'
          break
        else:
          dic['a'] -= 1
          tmp += 'a'

  print(ans)



Measured memory_bytes: 9260
N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]

H.sort(reverse=True)

min_score = pow(10, 9)
for i in range(N - K + 1):
    min_score = min(min_score, H[i] - H[i + K - 1])

print(min_score)



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

char s[ 1000001 ], pn[ 2000002 ];

int main( void ) {
	char *p;
	int i, n, sum;

	for ( ; scanf( "%d %*d %s", &n, s ), n; printf( "%d\n", sum ) ) {
		for ( i = 0; i < n * 2 + 1; i++ )
			sprintf( pn + i, i & 1 ? "O" : "I" );

		sum = 0;
		for ( p = s; ( p = strstr( ++p, pn ) ) != NULL; sum++ ) ;
	}

	return 0;
}

Measured memory_bytes: 1608
#include<bits/stdc++.h>
#define ll long long
#define sort(x) sort(x.begin(), x.end())
#define loop(n) for(ll i = 0; i<n; i++)
using namespace std;

int main(){
    int a, b, c;
    cin>>a>>b>>c;
    (a+b+c>=22)?(cout<<"bust"):(cout<<"win");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define PI 3.14159265359
#define sz(c) (int)c.size()
#define len(c) (int)c.length()
#define hcf(a, b) __gcd(a, b)
#define all(c) c.begin(), c.end()
#define vint vector<int>
#define vll vector<ll>
#define vpint vector<pair<int, int>>
#define vpll vector<pair<ll, ll>>
#define fr(it, a, b) \
    for (int it = (a); it < (b); it++)
#define tr(con, it) \
    for (auto it = con.begin(); it != con.end(); it++)
#define present(con, ele) (con.find(ele) != con.end())
#define cpresent(con, ele) (find(all(con), ele) != con.end())
#define maximum(a, b, c) (a > b ? (a > c ? a : c) : (b > c ? b : c))
#define minimum(a, b, c) (a < b ? (a < c ? a : c) : (b < c ? b : c))
typedef long long ll;
typedef long double lf;
typedef unsigned long long lu;
const ll mod = 1e9 + 7;
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, ans = 0, tp;
    cin >> n;
    tp = n;
    vector<ll> s;
    for (ll i = 2; i * i <= tp; i++)
    {
        if (n % i == 0)
        {
            ll cnt = 0;
            while (n % i == 0)
            {
                n /= i;
                cnt++;
            }
            s.pb(cnt);
        }
    }
    if (n > 1)
    {
        s.pb(1);
    }
    for (int i = 0; i < sz(s); i++)
    {
        ll num = sqrt(2 * s[i]);
        if (num * (num + 1) > 2 * s[i])
        {
            num--;
        }
        ans += num;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3676
import time
startTimeProblem=time.time()

import fileinput, sys, itertools, functools
from math import *
from bisect import *
from heapq import *
from collections import *

def lcm(a, b):  
    return (a*b)/gcd(a, b)

class InputHelper:
    def __init__(self):
        self.myinput = fileinput.input()

    def isLocal(self):
        return not fileinput.isstdin()

    def int(self):
        return int(self.myinput.readline().rstrip())

    def ints(self):
        return [int(_) for _ in self.myinput.readline().rstrip().split()]

    def str(self):
        return self.myinput.readline().rstrip()

    def strs(self):
        return [_ for _ in self.myinput.readline().rstrip().split()]

class OutputHelper:
    def int(self, a):
        print(a)    

    def ints(self, a):  
        print(" ".join([str(_) for _ in a]))
    
    def intsNL(self, a):
        for _ in a:
            print(_)
    
    def str(self, s):
        print(s)

    def strs(self, s):
        print(" ".join([_ for _ in s]))

    def strsNL(self, s):
        for st in s:
            print(st)

class ListNode:
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None

In = InputHelper()
Out = OutputHelper()

######################################

N, K = In.ints()

has = [0]*(N+1)
for i in range(K):
    d = In.int()

    for snuke in In.ints():
        has[snuke]+=1

ans = 0

for h in has:
    if h==0:
        ans+=1

Out.int(ans-1)
 
######################################

if len(sys.argv)>2 and sys.argv[2]=="TIMEIT":
    fin = (time.time()-startTimeProblem)*1000
    print("{:.2f}".format(fin) + "ms")

Measured memory_bytes: 74272
s = list(input())
s = set(s)
s = sorted(s)
m = 'abcdefghijklmnopqrstuvwxyz'

for i in range(len(m)):
    if s[i] != m[i]:
        print(m[i])
        exit(0)

    if i + 1 != len(m) and i + 1 == len(s):
        print(m[i + 1])
        exit(0)

print('None')

Measured memory_bytes: 3956
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
    int n;
    cout << setprecision(20);
    do{
        cin >> n;
        if (n==0)
            break;
        int a[n];
        double sum=0;
        double ava;
        for (int i=0;i<n;i++)
            cin >> a[i];
        for (int i=0;i<n;i++)
            sum+=a[i];
        ava=sum/n;
        sum=0;
        for (int i=0;i<n;i++)
            sum+=pow(a[i]-ava,2);
        cout << sqrt(sum/n) << endl;
    }while(0==0);
}


Measured memory_bytes: 3260
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
using namespace std;

int main()
{
	map<int, int> mp;
	int max;
	cin >> max;
	int count = 0;
	while (cin >> mp[count]) {
		count++;
		if (count == max) {
			break;
		}
	}
	int index = 0, ct = 0;
	bool flag = false;
	for (int i = 0; i != max; i++) {
		ct++;
		if (mp[index] == 2) {
			flag = true;
			break;
		}
		
		index = mp[index];
		index -= 1;
	}
	if (flag == true) {
		cout << ct << endl;
	}
	else {
		cout << "-1" << endl;
	}
	return 0;
}


Measured memory_bytes: 4992
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		switch(N) {
			case "Sunny":
				System.out.println("Cloudy");
				break;
			case "Cloudy":
				System.out.println("Rainy");
				break;
			case "Rainy":
				System.out.println("Sunny");
				break;
		}
	}

}

Measured memory_bytes: 35480
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b, k = map(int, input().split())

    def calc(a, b):
        if a % 2:
            a -= 1
            b += a // 2
            a //= 2
        else:
            b += a // 2
            a //= 2

    for i in range(k):
        if i % 2 == 0:
            if a % 2:
                a -= 1
                b += a // 2
                a //= 2
            else:
                b += a // 2
                a //= 2
        else:
            if b % 2:
                b -= 1
                a += b // 2
                b //= 2
            else:
                a += b // 2
                b //= 2

    print(a, b)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 3064
//
// Created by yamunaku on 2019/11/26.
//

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD9 998244353
#define MOD1 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)
#define CST(x) cout<<fixed<<setprecision(x)

using ll = long long;
using ld = long double;
using vi = vector<int>;
using mti = vector<vector<int>>;
using vl = vector<ll>;
using mtl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
template<typename T>
using heap = priority_queue<T, vector<T>, function<bool(const T, const T)>>;

int main(){
    // CFS;
    int n;
    string s;
    cin >> n >> s;
    rep(i,s.size()){
        s[i]=((s[i]-'A')+n)%26+'A';
    }
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
a=input().split(" ")
b=input().split(" ")
c=0
d=0
e=0
f=int(a[0])
g=int(a[0])
if int(a[1])!=0:
	for i in range(int(a[1])):
		if int(a[0])==int(b[i]):
			c=c+1
elif int(a[1])==0:
	print(a[0])

 
if c>=1:
	while str(f) in b:
		f=f+1
		d=d+1
	while str(g) in b:
		g=g-1
		e=e+1
	if d>e:
		print(g)
	elif e>d:
		print(f)
	elif e==d:
		print(g)
if c==0 and int(a[1])!=0:
	print(a[0])

Measured memory_bytes: 62120
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author author
 *
 */
public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] numbers = new int[n];
    for (int i = 0; i < n; i++) {
      numbers[i] = Integer.parseInt(sc.next());
    }

    Arrays.sort(numbers);

    if (numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1]) {
      System.out.println(0);
    } else {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    }

  }

}


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

int main(){
  int N,M,K; cin >> N >> M >> K;
  string s="No";
  for(int i=0; i<=N; i++){
    for(int j=0; j<=M; j++){
      if(i*M+j*N-2*i*j==K){
        s="Yes";
      }
    }
  }
  cout << s << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define inf 1e15
int main(){
  int size;
  cin>>size;
  vector<vector<int>>scores(size,vector<int>(3,0));
  for(int i=0;i<size;i++){
	for(int j=0;j<3;j++){
       cin>>scores[i][j];
    }
  }
  vector<vector<int>>dp(size,vector<int>(3,0));
  dp[size-1][0]=scores[size-1][0];dp[size-1][1]=scores[size-1][1];dp[size-1][2]=scores[size-1][2];
  for(int i=size-2;i>=0;i--){
      
      dp[i][0]=max(dp[i+1][1]+scores[i][0],dp[i+1][2]+scores[i][0]);
      dp[i][1]=scores[i][1]+max(dp[i+1][0],dp[i+1][2]);
      dp[i][2]=scores[i][2]+max(dp[i+1][0],dp[i+1][1]);
  }
  int ans=0;
  for(int i=0;i<3;i++){
      ans=max(ans,dp[0][i]);
  }
  cout<<ans;
  return 0;
}

Measured memory_bytes: 11136
#include <iostream>
#include <stdio.h>
#include <algorithm>
static const int MAXN = 200020;
using namespace std;
int main()
{
    // Input
    int n,R[MAXN];
    cin >> n;
    for (int i=0; i<n; i++)
        cin >> R[i];
    // Deal
    int minv = R[0];//  初始的最小值
    int maxv = R[1] - R[0];//   初始的maxv
    for (int i=0; i<n-1; i++){
        maxv = max(maxv,R[i+1] - minv);
        minv = min(R[i+1],minv);
    }
    // Output
    cout << maxv << endl;
    return 0;
}


Measured memory_bytes: 3868
using System;
using System.Collections.Generic;
using System.Linq;
 
public class Program
{
	public static void Main()
	{
		var rule = new int[]{2,5,5,4,5,6,3,7,6};
		var split = Console.ReadLine().Split().Select(int.Parse).ToList();
		var n = split[0];
		var m = split[1];
		split = Console.ReadLine().Split().Select(int.Parse).ToList();
		Check(split);
		var rule2 = new Dictionary<int,int>();
		foreach(var v in split){
			rule2.Add(rule[v-1],v);
		}
		var dp_dic = new Dictionary<int,int>();
		dp_dic.Add(0,0);
		foreach(var loop in Enumerable.Range(1,n)){
			foreach(var d in rule2.OrderByDescending(x=>x.Value)){
				if(dp_dic.Keys.Contains(loop-d.Key)){
					if(dp_dic[loop-d.Key]==int.MinValue)continue;
					if(dp_dic.Keys.Contains(loop)){
						if(dp_dic[loop]<dp_dic[loop-d.Key]+1){
							dp_dic[loop] = dp_dic[loop-d.Key]+1;
						}
						continue;
					}
					dp_dic.Add(loop,dp_dic[loop-d.Key]+1);
				}
			}
			if(!dp_dic.Keys.Contains(loop)){
				dp_dic.Add(loop,int.MinValue);
			}
		}
		while(n>0){
			foreach(var d in rule2.OrderByDescending(x=>x.Value)){
				if(n-d.Key<0)continue;
				if(dp_dic[n-d.Key]==dp_dic[n]-1){
					Console.Write(d.Value);
					n-=d.Key;
					break;
				}
			}
		}
		Console.WriteLine();
	}
	public static void Check(List<int> list){
		if(list.Contains(2)&&list.Contains(3)){
			list.Remove(2);
		}
		if(list.Contains(3)&&list.Contains(5)){
			list.Remove(3);
		}
		if(list.Contains(2)&&list.Contains(5)){
			list.Remove(2);
		}
		if(list.Contains(6)&&list.Contains(9)){
			list.Remove(6);
		}
	}
}


Measured memory_bytes: 18268
#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
 
template <class T> using V = vector<T>;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll a,b;
  	ci(a>>b);
  if(a%3==0||b%3==0||(a+b)%3==0) co("Possible")
    else co("Impossible")
    }

Measured memory_bytes: 256
//
//  main.cpp
//  AC
//
//  Created by makinofuya on 2019/07/08.
//  Copyright © 2019 makinofuya. All rights reserved.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>
#include <map>

typedef long long ll;
using namespace std;
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define out(s) cout << s << endl



int main(){
    string s1,s2,s3;cin >> s1 >> s2 >> s3;
    char now=s1[0];
    s1=s1.erase(0,1);
    int turn;
    while(1){
        if(now=='a'){
            now=s1[0];
            s1=s1.erase(0,1);
            turn=1;
        }
        else if(now=='b'){
            now=s2[0];
            s2=s2.erase(0,1);
            turn =2;
        }
        else if(now=='c'){
            now=s3[0];
            s3=s3.erase(0,1);
            turn=3;
        }
        else if(s1=="" or s2 == "" or s3=="")break;
        
    }
    
    if(turn==1)cout << "A" << endl;
    if(turn==2)cout << "B" << endl;
    if(turn==3)cout << "C" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;

int main(){
  int n,p,S[100000],T[100000];
  bool exist;
  cin >> n;
  rep(i,n)cin >> S[i];
  cin >> p;
  rep(i,p)cin >> T[i];

  int h;

  //昇順にソート
  rep(i,n){
    int ch = i;
    REP(j,i,n){
      if(S[ch] > S[j])ch = j;
    }
    h=S[ch];
    S[ch]=S[i];
    S[i]=h;
  }

  int count=0;

  rep(i,p){
    int lef=0,rig=n;
    exist = false;

    //2分探索
    while(lef < rig){
      int index=(lef+rig)/2;
      if(T[i] == S[index]){
	exist=true;
	break;
      }
      else if(T[i] < S[index]){
	rig=index;
      }
      else {
	lef = index+1;
      }
    }
    if(exist){
      count++;
    }
  }
  cout << count << endl;


}

Measured memory_bytes: 868
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)

const string YES = "YES";
const string NO = "NO";

void solve(long long N, std::vector<long long> A){
    set<ll> s;
    for(ll x : A){
        s.insert(x);
    }
    if(s.size() == N){
        cout << YES << endl;
    }else{
        cout << NO << endl;
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 11136
import java.io.*;
import java.util.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        while(true){
        	String in=br.readLine();
			if(in.equals("0 0")) break;
            String[] a=in.split(" ");
            int n=Integer.parseInt(a[0]);
            int x=Integer.parseInt(a[1]);
            List<String> l=new ArrayList<String>(); 
        	for(int i=1;i<=n;i++){
            	for(int j=2;j<=n;j++){
                	for(int k=3;k<=n;k++){
                		if(i!=j&&j!=k&&k!=i&&i+j+k==x){
                			int[] q={i, j, k};
                			Arrays.sort(q);
                			String s=Arrays.toString(q);
                			if(l.indexOf(s)==-1) l.add(s);
                		}
                	}
            	}
        	}
        	System.out.println(l.size());
        }
	}
}

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

const int N = 100000 + 10;
const int M = 1000 + 10;
long long n, p, x, W, tmp = -1;
long long a[N], b[N], w[N], s[N], dp[M][N];

int main() 
{
	cin >> n >> W;
	for (int i = 0 ; i < n; i++) {
		cin >> w[i] >> s[i];
	}
	for (int i = 0; i < W; i++){
		dp[0][i] = 0;
	}
	for (int i = 0; i < n; i++){
		dp[i][0] = 0;
	}
	dp[0][w[0]] = s[0];
	for (int i = 1; i < n; i++) {
		for (int j = 1; j <= W; j++){
			if (w[i] > j)
				dp[i][j] = dp[i - 1][j];
			else 
				dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + s[i]);
		}
	}
	for (int i = 0; i <= W; i++) 
		tmp = max(dp[n - 1][i], tmp);
	cout << tmp;
return 0;
}


Measured memory_bytes: 82176
#include "bits/stdc++.h"
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <algorithm>
#include <numeric>
#include <random>
#include <stdio.h>
#include <bitset>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

typedef long long LL;
typedef long double LD;
typedef string ST;


#define REP(i,n) for(LL (i)=0;(i)<(n);(i)++)
#define ALL(v) v.begin(), v.end()
#define PRINTLN(v) {LL i=0; for(auto (a): v ){   cerr <<i << " : "<<  a << endl; i++;}}
#define PRINTSP(v) for(auto (a): v ) {cerr << a << " ";} cerr << endl

void func() {
  LD A;
  cin >> A;
  LD B;
  cin >> B;
  LD X;
  cin >> X;
  LD S = X / (A);
  LD radian = 0;
  LD radian_ = 0;
  if (S >= (0.5 * A * B)) {
    //LD digree = atan(2*(A*B-S)/(A*A)) / (2 * M_PI) * 360.0;
    //LD digree = atan2(2*(A*B-S),(A*A)) / (2 * M_PI) * 360.0;
    radian = atan2(2*(A*B-S),(A*A));

    LD h = (A * B - S) * 2 / A;
    radian_ = atan2(h, A);




    //fprintf(stdout, "%.20llf", digree);
    //cout << atan((2 * A * B - 2 * S) / (A * A))/(2*M_PI)*360;
  }
  else{
    //LD digree = atan(0.5 * B * B / S) / (2 * M_PI) * 360.0;
    //LD digree = atan2(0.5 * B * B , S) / (2 * M_PI) * 360.0;
    //fprintf(stdout, "%.20llf", digree);
    radian = atan2(0.5 * B * B, S);
    LD w = S * 2 / B;
    radian_ = atan2(B, w);

  }
  LD digree = radian / (2 * M_PI) * 360.0;
  LD digree_ = radian_ / (2 * M_PI) * 360.0;
  fprintf(stdout, "%.20llf\n", digree_);
  //fprintf(stdout, "%.20llf\n", digree);
  //fprintf(stderr, "%.20llf\n", digree - digree_);

}

#ifdef CALC_TIME 
#include <windows.h>
int main()
{
  LARGE_INTEGER freq;
  QueryPerformanceFrequency(&freq);
  LARGE_INTEGER start, end;
  QueryPerformanceCounter(&start);
  // 何かの処理
  func();
  QueryPerformanceCounter(&end);
  double time = static_cast<double>(end.QuadPart - start.QuadPart) * 1000.0 / freq.QuadPart;
  fprintf(stderr, "\n%lf[ms]\n", time);
  return 0;
}
#else 
int main()
{
  func();
  return 0;
}
#endif





Measured memory_bytes: 256
// 2011/07/27 Tazoe

#include <iostream>
using namespace std;

int main()
{
	int seg[11][7] = {{0,1,1,1,1,1,1},	// eÌf[^
	                  {0,0,0,0,1,1,0},
	                  {1,0,1,1,0,1,1},
	                  {1,0,0,1,1,1,1},
	                  {1,1,0,0,1,1,0},
	                  {1,1,0,1,1,0,1},
	                  {1,1,1,1,1,0,1},
	                  {0,1,0,0,1,1,1},
	                  {1,1,1,1,1,1,1},
	                  {1,1,0,1,1,1,1},
	                  {0,0,0,0,0,0,0}};	// seg[10]Íñ\¦

	while(true){
		int n;
		cin >> n;
		if(n==-1)
			break;

		int cur = 10;		// ¡ÌiúlÍñ\¦j
		int nxt;		// Ì
		for(int i=0; i<n; i++){
			cin >> nxt;
			for(int j=0; j<7; j++)
				cout << (seg[cur][j]+seg[nxt][j])%2;	// r¼I_a
			cout << endl;
			cur = nxt;
		}
	}

	return 0;
}

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

public class Main {
	public static void main(String[] args) throws IOException {
		new Main().run();
	}
	private void run() throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		StringTokenizer st = new StringTokenizer(reader.readLine());
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(st.nextToken());
		}
		int m = Integer.parseInt(reader.readLine());
		st = new StringTokenizer(reader.readLine());
		for (int i = 0; i < m; i++) {
			if (subsetSum(n, a, Integer.parseInt(st.nextToken()))) {
				System.out.println("yes");
			} else {
				System.out.println("no");
			}
		}
		reader.close();
	}
	
	private boolean subsetSum(int n, int[] a, int s) {
		boolean[][] dp = new boolean[n+1][s+1];
		dp[0][0] = true;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j <= s; j++) {
				if (j < a[i]) {
					dp[i+1][j] = dp[i][j];
				} else {
					dp[i+1][j] = dp[i][j] || dp[i][j-a[i]];
				}
			}
		}
		return dp[n][s];
	}
}


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

int main()
{
	int a,b,c,sum=0;
	char s[100];
	cin>>s;
    for(int i=0;i<4;i++)
    {
        if(s[i]=='+')
            sum++;
        else if(s[i]=='-')
            sum--;
    }
    cout<<sum<<endl;
	
	return 0;
}
	

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

ll DP[2005][2005]; //Sのi文字目までとTのj文字目までを使ってできる回文の数

int main() {
  string S, T;
  cin>>S;
  for(ll i=S.size()-1;i>=0;--i) {
    T += S[i];
  }
  ll next1[26][S.size()+1];
  ll next2[26][S.size()+1];
  for(ll i=0;i<26;++i) {
    for(ll j=0;j<=S.size();++j) {
      next1[i][j] = -1;
      next2[i][j] = -1;
    }
  }
  for(ll j=S.size()-1;j>=0;--j) {
    for(ll i=0;i<26;++i) {
      next1[i][j] = next1[i][j+1];
      next2[i][j] = next2[i][j+1];
    }
    next1[S[j]-'a'][j] = j+1;
    next2[T[j]-'a'][j] = j+1;
  }
  DP[0][0] = 1;
  for(ll i=0;i<=S.size();++i) {
    for(ll j=0;j<=T.size();++j) {
      for(ll k=0;k<26;++k) {
        if(next1[k][i]==-1 || next2[k][j]==-1) continue;
        DP[next1[k][i]][next2[k][j]] += DP[i][j];
        DP[next1[k][i]][next2[k][j]] %= mod;
      }
    }
  }
  ll ans = 0;
  ll num;
  for(ll i=0;i<=S.size();++i) {
    for(ll j=0;j<=T.size();++j) {
      if(i+j>S.size()) continue;
      num = 0;
      for(ll k=0;k<26;++k) {
        if(next1[k][i]!=-1 && next1[k][i]<=S.size()-j) num++;
      }
      ans += DP[i][j]*(num+1)%mod;
      ans %= mod;
    }
  }
  cout<<ans-1<<endl;
}



Measured memory_bytes: 35364
#include<stdio.h>
int main()
{
	int W,H,x,y,r,xr1,xr2,yr1,yr2;
	scanf("%d %d %d %d %d", &W, &H, &x,&y,&r);
	xr1 = x + r;
	xr2 = x - r;
	yr1 = y + r;
	yr2 = y - r;
	if(0<=x<=W)
	{
		if (0 <= xr2 && xr1 <= W)
		{
			if (0 <= y <= H)
			{
				if (0 <=yr2 && yr1 <= H) printf("Yes\n");
				else  printf("No\n");
			}
			else printf("No\n");
		}
		else printf("No\n");
	}
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 1012
n = int(input())

dp = [[0]*16 for i in range(n)]
for j in range(16):
  if j in [1,6,9]:
    dp[1][j] = 1
  else:
    dp[1][j] = 1

for i in range(2,n):
  for j in range(16):
    k = j//4
    dp[i][j] = dp[i-1][k]+dp[i-1][k+4]+dp[i-1][k+8]+dp[i-1][k+12]
    if j == 1:
      dp[i][j] -= dp[i-1][8]
    elif j == 6:
      dp[i][j] -= dp[i-1][1]
    elif j == 9:
      dp[i][j] -= dp[i-1][2]+dp[i-2][2]+dp[i-2][3]
    elif j == 13:
      dp[i][j] -= dp[i-2][2]
    else:
      continue

count = 0
for j in range(16):
  count += dp[n-1][j]

print(count%1000000007)

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

using namespace std;

typedef long long ll;

const int MX = 3003;

template<typename T> void cmax(T &x, const T &y)
{
	if(y > x) x = y;
}

template<typename T> void read(T &x)
{
	x = 0;
	char c = getchar();
	bool f = 0;
	while(!isdigit(c) && c!='-') c = getchar();
	if(c == '-') f = 1, c = getchar();
	while(isdigit(c)) x = x*10+c-'0', c = getchar();
	if(f) x = -x;
}

int n;
ll mod;
ll S[MX][MX], C[MX][MX];
ll p22[MX], p2[MX*MX];

void work()
{
	S[0][0] = C[0][0] = 1;
	for(int i=1; i<=n+1; i++)
	{
		C[i][0] = 1;
		for(int j=1; j<=i; j++)
		{
			S[i][j] = (j*S[i-1][j] + S[i-1][j-1]) % mod;
			C[i][j] = (C[i-1][j] + C[i-1][j-1]) % mod;
		}
	}
	p2[0] = 1, p22[0] = 2;
	for(int i=1; i<=n; i++) p22[i] = p22[i-1]*p22[i-1] % mod;
	for(int i=1; i<=n*n; i++) p2[i] = p2[i-1]*2 % mod;
	ll ans = 0;
	for(int i=0; i<=n; i++)
	{
		ll coe = (i&1) ? (mod-C[n][i]) : (C[n][i]);
		for(int k=0; k<=i; k++)
		{
			ll con = S[i+1][k+1] * p2[(n-i)*k] % mod * p22[n-i] % mod;
			ans = (ans + coe*con) % mod;
		}
	}
	printf("%lld\n", ans);
}

int main()
{
	read(n), read(mod);
	work();
	return 0;
}

Measured memory_bytes: 211584
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <string.h> 
#include <stack>
#include <bitset>
#include <map>
#include <cmath>
#include <climits>
#include <queue>

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

using namespace std;

int main() {
	int n;
	scanf("%d", &n);
	if (n >= 10) n %= 10;

	if (n == 3) printf("bon\n");
	else if (n == 0 || n == 1 || n == 6 || n == 8) printf("pon\n");
	else printf("hon\n");
}

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

#define int long long

int N;
int A[5];

signed main() {
  cin >> N;
  int K = 1e18;
  for (int i = 0; i < 5; i++) {
    cin >> A[i];
    if (A[i] < K) {
      K = A[i];
    }
  }

  int ans = ((N + K - 1) / K) + 4;

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
/*
      author  : nishi5451
      created : 14.08.2020 22:05:41
*/

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

const int INF = 2e9;

int main(){
    int n,time;
    cin >> n >> time;
    int cost = INF;
    rep(i,n){
        int c,t;
        cin >> c >> t;
        if(time>=t){
            cost = min(cost,c);
        }
    }
    if(cost == INF){
        cout << "TLE" << endl;
    }
    else{
        cout << cost << endl;
    }
    return 0;
}

Measured memory_bytes: 3540
#include<stdio.h>

int main(void){
    int a,b,c,work;
    
    scanf("%d%d%d",&a,&b,&c);
    
    if(a>b){
        work=a;
        a=b;
        b=work;
    }
    
     if(b>c){
        work=b;
        b=c;
        c=work;
    }
    
     if(a>b){
        work=a;
        a=b;
        b=work;
    }
    
    printf("%d %d %d\n",a,b,c);
    
    return 0;
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

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

	ll n, k;cin >> n >> k;
	ll ans = 0;
	REP(i, n){
		ll a;cin >> a;
		if(a >= k)ans++;
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <math.h> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;

int main(){
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    ll a,b,c;
    cin >> a >> b >> c;

    ll res;

    if(a == b)
    {
        res = c;
    }
    else if(b== c) res = a;
    else res = b;

    cout << res << endl;
    return 0;    
}



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

#define ll long long

using namespace std;

map < pair <int, int>, int > mm;

vector <int> preans;
vector <int> ans;

int in[1005];

vector <int> g[1005];

int mt[1005][1005];

bool dfs(int v, int start)
{
    for(int j = 0; j < g[v].size(); j++)
    {
        int to = g[v][j];
        if(in[to] && to != start) return false;
    }
    for(int j = 0; j < g[v].size(); j++)
    {
        int to = g[v][j];
        if(to == start) return true;
    }
    for(int j = 0; j < g[v].size(); j++)
    {
        int to = g[v][j];
        in[to]++;
        preans.push_back(to);
        if(dfs(to, start)) return true;
        preans.pop_back();
        in[to]--;
    }
    return false;
}

int main()
{
    int n,m,x,y;
    cin >> n >> m;
    for(int i = 0; i < m; i++)
    {
        cin >> x >> y;
        if(mm[{min(x, y), max(x, y)}])
        {
            cout << 2 << endl;
            cout << x << endl;
            cout << y;
            return 0;
        }
        mm[{min(x, y), max(x, y)}]++;
        g[x].push_back(y);
        mt[x][y] = 1;
    }
    for(int i = 1; i <= n; i++)
    {
        in[i]++;
        preans.push_back(i);
        if(dfs(i, i))
        {
            int cur = 0;
            preans.push_back(i);
            while(cur != preans.size() - 1)
            {
                ans.push_back(preans[cur]);
                for(int j = preans.size() - 1; j >= cur + 1; j--)
                {
                    if(mt[preans[cur]][preans[j]])
                    {
                        cur = j;
                        break;
                    }
                }
            }
            cout << ans.size() << endl;
            for(int i = 0; i < ans.size(); i++)
            {
                cout << ans[i] << endl;
            }
            return 0;
        }
        in[i]--;
        preans.pop_back();
    }
    cout << -1;
}


Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P3;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(1e4 + 5);
const double EPS = 1e-8;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

string rec(string &s, int &pos){
    string res ="";
    int inc = 0;
    for(;pos < s.size();pos++){
        if(s[pos]=='+') inc++;
        if(s[pos]=='-') inc--;
        if(s[pos] >= 'A' && s[pos] <= 'Z'){
            char c = 'A'+(s[pos]-'A'+inc+26*5)%26;
            res.push_back(c);
            inc = 0;
        }
        if(s[pos]=='?'){
            res.push_back('A');
            inc = 0;
        }
        if(s[pos]=='['){
            pos++;
            string tmp = rec(s,pos);
            reverse(ALL(tmp));
            res += tmp;
        }
        else if(s[pos]==']'){
            break;
        }
    }
    return res;
}

int main() {
    string s;
    while(cin >> s, s!="."){
        string ans="";
        REP(i,s.size()) ans += rec(s,i);
        cout << ans << endl;
    }
    return 0;
}



Measured memory_bytes: 3148
'use strict';

function Main(INPUT) {
    const input = INPUT.split("\n")[0].split(" ");
    if (input[0] == input[1]) {
        console.log(input[2]);
    } else {
        console.log(input[0] == input[2] ? input[1] : input[0]);
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <ios>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
#define itn int
#define retrun return
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
using namespace std;
typedef long long llong;
typedef pair<int, int> pii;
llong gcd(llong a, llong b) {
	if (a < b) std::swap(a, b);
	if (a % b == 0)
		return b;
	else
		return gcd(b, a % b);
}
llong lcm(llong a, llong b) {
	llong g = gcd(a, b);
	return a * b / g;
}
//ここまで共通
int X, Y, Z;
int main() {
	cin >> X >> Y >> Z;
	cout << Z << " " << X << " " << Y << endl;
	return 0;
}

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

  int main()
  {
  
  int64_t a,b,c;
  cin >> a >> b >> c;
  if (a<0) {a*=-1;}
  if (b<0) {b*=-1;}
  if (c<0) {c*=-1;}
    
  int64_t n = b*c;
  int64_t d = a / c;
  int64_t e = a % c;
  int64_t f = b-d;
  int64_t p = f % 2;
   
  if (n<0) {n*=-1;}
  if (d<0) {d*=-1;}
  if (e<0) {e*=-1;}
  if (f<0) {f*=-1;}
  if (p<0) {p*=-1;}
    
  if ( n < a ) {
  cout << a-n << endl;
               }
  else if ( n == a ){
    cout << 0 << endl;
                    }
  else
  {
    
  if ( p == 0 ){
    cout << e << endl;
               }
  else {
    cout << c - e << endl;
       }
  }  
  }

Measured memory_bytes: 3620
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;

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

int main(){
    string S;
    cin>>S;
    ll ans = 0;
    rep(i,0,4){
        if(S[i] =='+')ans++;
        else ans--;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
n,m=map(int,input().split())
a=[]

for i in range(m):
    ai,bi=map(int,input().split())
    a.append([ai,bi])
              
ni=[0]*n
nii=[]
    
def pathm(n,a,bi,pcnt,ni):
    if n==1:
        pcnt=pcnt+1
#        print("2:","n:",n,"bi:",bi,"pcnt:",pcnt)
        return pcnt
    else:
        n=n-1
        nii.append(bi)
        for mm in range(m):
            if a[mm][0]==bi and not a[mm][1] in nii:
#            if a[mm][0]==bi :
                ni[a[mm][1]-1]=1
#                print("1:","n:",n,"mm:",mm,"a[mm][1]:",a[mm][1],"pcnt:",pcnt)
                pcnt=pathm(n,a,a[mm][1],pcnt,ni)
            if a[mm][1]==bi and not a[mm][0] in nii:
#            if a[mm][1]==bi  and ni[a[mm][0]-1]==0 :
                ni[a[mm][0]-1]=1
#                ni[mm]=1
#                print("1:","n:",n,"mm:",mm,"a[mm][0]:",a[mm][0],"pcnt:",pcnt)
                pcnt=pathm(n,a,a[mm][0],pcnt,ni)
        nii.pop()
        return pcnt       
                
pcnt=0
pcnt1=pathm(n,a,1,pcnt,ni)
print(pcnt1)


Measured memory_bytes: 3064