akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
using namespace std;

int main(){
	int w[3] = {0};
	int k[3] = {0};
	int w_sum = 0, k_sum = 0;
	int input;
	int i,j;
	for(i=0;i<10;i++){
		cin>>input;
		for(j=0;j<3;j++){
			if(w[j] < input){
				w[0] = input;
				sort(w, w+3);
				break;
			}
		}
	}
	
	for(i=0;i<10;i++){
		cin>>input;
		for(j=0;j<3;j++){
			if(k[j] < input){
				k[0] = input;
				sort(k, k+3);
				break;
			}
		}
	}
	for(i=0;i<3;i++){
		w_sum += w[i];
		k_sum += k[i];
	}
	cout<<w_sum<<" "<<k_sum<<endl;
	return 0;
}

Measured memory_bytes: 1180
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T> &p){ cout << "[" << p.first << ", " << p.second << "]"; return os; }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define For1(i, n) for(int i = 1; i <= (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << "\n"; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;
#include <set>

int main(void){
    Cin(int, n);
    Cins(int, n, a);
    vc<int> ind(n+1);
    For(i, n) ind[a[i]] = i;

    set<int> p {-1, n};
    ll ans = 0;
    For1(i, n){
        int m = ind[i];
        auto itr = p.upper_bound(m);
        int r = *itr, l = *(--itr);
        // printf("%d : [%d, %d, %d] %d\n", i, l, m, r, (m-l)*(r-m));
        ans += (ll)i*(m-l)*(r-m);
        
        p.insert(ind[i]);
    }
    Cout(ans);
}




Measured memory_bytes: 11136
N = int(input())
H = list(map(lambda x: int(x), input().split(' ')))

count = 0
ans = 0

for i in range(N - 1):
    if H[i] - H[i+1] >= 0:
        count += 1
        if count > ans:
            ans = count
    else:
        count = 0
        
print(ans)

Measured memory_bytes: 14252
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>

using namespace std;

void dfs(vector<string> &s, int node, int l, int r) {
    if (l >= r) return;
    int a = -1;
    bool f = false;
    for (int i = 0; i < r; i++) {
        if (node < s[i].size() && s[i][node] == '.') {
            f = true;
            if (node+1 < s[i].size() && isalpha(s[i][node+1])) {
                s[i][node] = '+';
                if (a == -1)  a = i+1;
                else {
                    for (int j = a; j < i; j++) if (node < s[j].size()) s[j][node] = '|';
                    dfs(s, node+1, a, i);
                    a = i+1;
                }
            }
        }
    }
    if (f) dfs(s,node+1,l,r);
}

int main(void){
    int n;
    while (cin>>n && n) {
        vector<string> s(n);
        for (int i = 0; i < n; i++) cin >> s[i];
        
        dfs(s,0,0,n);
        
        for (int i = 0; i < n; i++) 
            for (int j = 0; j < s[i].size(); j++) 
                if (s[i][j] == '.') s[i][j] = ' ';
        
        for (int i = 0; i < n; i++) cout << s[i] << endl;
    }
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
int main(){
int A,B,C,D;
cin >> A >> B >> C >> D;
  int x=A+B;
  int y=C+D;
if(x>y){
cout << "Left";
}
else if(x<y){
cout << "Right";
}
else{
cout << "Balanced";
}
}

Measured memory_bytes: 256
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
// #define MOD 1000000007
#define rp(i,n) for(int i=0;i<(n);++i)
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
#define ot(x) cout<<(x)
#define ote(x) cout<<(x)<<endl
#define all(x) (x).begin(),(x).end()

int main(){
	int a,b; cin>>a>>b;
	int count = 0;
	for(int i=1; i<=9; ++i){
		for(int j=0; j<=9; ++j){
			for(int k=0; k<=9; ++k){
				int s = i*10000 + j*1000 + k*100 + j*10 + i;
				if(a<=s && s<=b){
					count++;
					// ote(s);
				}
			}
		}
	}
	ote(count);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)




#define INF INT_MAX/2
int N, A[101010];
//-----------------------------------------------------------------------------------
int rec(int cu) {
    // 単調非減少
    int i = cu, pre = -INF;
    while (i < N) {
        if (pre <= A[i]) {
            // ok
            pre = A[i]; i++;
        } else break;
    }

    if (i == N) return 1;

    int j = cu;
    pre = INF;
    while (j < N) {
        if (A[j] <= pre) {
            // ok
            pre = A[j]; j++;
        } else break;
    }

    if (j == N) return 1;

    return rec(max(i, j)) + 1;
}
//-----------------------------------------------------------------------------------
int main() {
    cin >> N;
    rep(i, 0, N) scanf("%d", &A[i]);

    printf("%d\n", rec(0));
}

Measured memory_bytes: 640
import sys
readline = sys.stdin.readline

N = int(readline())

G = [[] for i in range(N)]
from collections import defaultdict
E = defaultdict(int)

for i in range(N - 1):
  a,b = map(int,readline().split())
  G[a - 1].append(b - 1)
  G[b - 1].append(a - 1)
  E[(a - 1, b - 1)] = i

from collections import deque
q = deque([])
ans = [None] * (N - 1)

q.append([0, -1, 0])
maxcol = 0
while q:
  v, parent, color = q.popleft()
  if color > maxcol:
    maxcol = color
  if (v, parent) in E:
    ans[E[(v, parent)]] = color
  elif (parent, v) in E:
    ans[E[(parent, v)]] = color
  next_col = 0
  for child in G[v]:
    if child == parent:
      continue
    next_col += 1
    if next_col == color:
      next_col += 1
    q.append([child, v, next_col])
    
print(maxcol)
for a in ans:
  print(a)

Measured memory_bytes: 48980
import numpy as np
N, M, X = map(int,input().split())
C = []
A = []
for i in range(N):
    c = 0
    a = []
    c, *a = map(int,input().split())
    C.append(c)
    A.append(a)
inf = float("inf")
res = inf
for bit in range(1 << N):
    Cost = 0
    Wise = [0] * M
    for i in range(N):
        if (bit >> i) & 1:# i冊目を買うときの処理
            Cost += C[i]
            for j, a in enumerate(A[i]):
                Wise[j] += a
            #else:# i冊目を買わないときの処理（今回は何もしないので省略）
    if min(Wise) >= X and Cost <= res:
        res = Cost
if res == inf:
    print("-1")
else:
    print(res)


Measured memory_bytes: 27100
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int i;
    int ans=0;
    for(i=0;i<s.size();i++)
    {
        if(s[i]=='+')
        {
            ans++;
        }
        else{
            ans--;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
import bisect

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort()
B.sort()
C.sort()

numpattern = 0

for i in range(N):
    numsmallerA = bisect.bisect_left(A,B[i])
    numbiggerC = N - bisect.bisect_right(C,B[i])
    numpattern += numsmallerA * numbiggerC

print(numpattern)

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

main() {
  int n; cin >> n;
  vi aev, aod;
  rep(i, n) {
    int a;
    cin >> a;
    if (i % 2 == 0) {
      aod.push_back(a);
    } else {
      aev.push_back(a);
    }
  }
  rep(i, n) {
    if (n % 2 == 0) {
      if (aev.size() > 0) {
        cout << aev.back();
        aev.pop_back();
      } else {
        cout << aod.front();
        aod.erase(aod.begin());
      }
    } else {
      if (aod.size() > 0) {
        cout << aod.back();
        aod.pop_back();
      } else {
        cout << aev.front();
        aev.erase(aev.begin());
      }
    }
    if (i == n - 1) break;
    cout << ' ';
  }
  cout << endl;
}

Measured memory_bytes: 3188
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H& b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H& b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H& b) const { return x == b.x && y == b.y; }
	bool operator!=(const H& b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P& b) const { return cost < b.cost; }
	bool operator>(const P& b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E& b) const { return cost < b.cost; }
	bool operator>(const E& b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T& a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T& a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j % i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int n;
int b[200];
signed main() {
	cin >> n;
	for (int i = 0; i < n - 1; i++)
		cin >> b[i];
	int ans = 0;
	for (int i = 1; i < n - 1; i++) {
		ans += min(b[i - 1], b[i]);
	}
	ans += b[0] + b[n - 2];
	cout << ans << endl;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func sliceAtoi(arr []string, length int) []int {
	si := make([]int, 0, length)
	for _, a := range arr {
		i, _ := strconv.Atoi(a)
		si = append(si, i)
	}
	return si
}

func main() {
	a, b := nextLine(), nextLine()
	arr := strings.Split(a, " ")
	n, _ := strconv.Atoi(arr[0])
	k, _ := strconv.Atoi(arr[1])

	p := sliceAtoi(strings.Split(b, " "), n)
	sort.Sort(sort.IntSlice(p))

	sum := 0
	for _, x := range p[0:k] {
		sum += x
	}
	fmt.Println(sum)
}


Measured memory_bytes: 1812
#include <stdio.h>
#include <stdlib.h>

#define MALLOC(var, elem, num) var = (elem *)malloc(sizeof(elem) * (num))
#define FREE(var) do {\
  free(var);\
  var = NULL;\
} while(0)

int main(int ac, char **av) {
  int N, max_val, max_pos, i, t, res;
  int *pi;

  max_pos = -1;
  max_val = 0;

  scanf("%d", &N);
  MALLOC(pi, int, N);

  for (i = 0; i < N; i < i++) {
    t = 0;
    scanf("%d", &t);
    pi[i] = t;
    if (max_val < t) {
      max_val = t;
      max_pos = i;
    }
  }

  res = 0;
  for (i = 0; i < N; i++) {
    if (i == max_pos) {
      res += pi[i] / 2;
    } else {
      res += pi[i];
    }
  }

  printf("%d\n", res);

  FREE(pi);
}

Measured memory_bytes: 128
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define max0(a,b,c) max(max(a,b),c)
#define min0(a,b,c) min(min(a,b),c)
#define ft first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define all(v) (v).begin(),(v).end()
#define mod 1000000007
using namespace std;
using Graph = vector<vector<int>>;
typedef long long lint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldouble;
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<ull> ulvec;
typedef vector<double> dvec;
typedef vector<pair<int,int>> pvec;
typedef vector<pair<ll,ll>> plvec;
typedef vector<tuple<ll,ll,ll>> tvec;
typedef vector<string> svec;

int main(){
    int n,t;
    cin>>n>>t;
    pvec p(n);
    rep(i,n){
        int a,b;
        cin>>a>>b;
        p[i]=mp(a,b);
    }
    sort(all(p));
    bool flag=false;
    int k;
    rep(i,n){
        if(p[i].sc<=t){
            k=i;
            flag=true;
            break;
        }
    }
    if(flag) cout<<p[k].ft;
    else cout<<"TLE";
}

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

int main() {
  int n, y;
  cin >> n >> y;
  bool f = false;
  vector<int> a(3);
  rep(i,n+1){
    rep(j,n+1){
      if (y - 10000*i -5000*j == 1000 * (n - i - j) && n -i -j >=0) {
        f = true;
        a[0] = i;
        a[1] = j;
        a[2] = n- i -j;
      }
    }
  }
  if (f) {
    cout << a[0] << " " << a[1] << " " << a[2] << endl;
  } else {
    cout << "-1 -1 -1" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll f[110];
int main(){
  ll n,m,x,a;
  cin>>n>>m>>x;
  for(int i=0;i<m;i++){
    cin>>a;
    f[a]=1;
  }
  ll cnt1=0,cnt2=0,ans;
  for(int i=0;i<=x;i++)cnt1+=f[i];
  for(int i=x;i<=n;i++)cnt2+=f[i];
  ans=min(cnt1,cnt2);
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 500000

void buildmaxheap(int *);
void maxheapify(int *,int);
int left(int);
int right(int);
int n;
int main(){
  int i;
  int A[N];

  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d",&A[i]);
  }

buildmaxheap(A);

  for(i=1;i<=n;i++){
    printf(" %d",A[i]);
  }
printf("\n");

return 0;
}

void buildmaxheap(int *A){
  int i;
  for(i=n/2;i>=1;i--){
    maxheapify(A,i);
  }
}

void maxheapify(int *A,int i){
  int l,r,temp,largest;
  l=left(i);
  r=right(i);
  if((l<=n)&&(A[l]>A[i])){
    largest=l;
  }
  else{
    largest=i;
  }
  if((r<=n)&&(A[r]>A[largest])){
    largest=r;
  }

  if(largest!=i){
    temp=A[i];
    A[i]=A[largest];
    A[largest]=temp;
    maxheapify(A,largest);
  }
}

int left(int id){
  int lid;
  lid=2*id;
  /*if(lid<=n){*/
  return lid;/*}
  else{return -1;}*/
}

int right(int id){
  int rid;
  rid=2*id+1;
  /*if(rid<=n){*/
  return rid;/*}
  else{return -1;}*/
}



Measured memory_bytes: 3664
a,b,c=map(int,input().split())
_a=[]
_b=[]
for i in range(1,101):
    if a%i==0:
        _a.append(i)
    if b%i==0:
        _b.append(i)
_share=[]
for i in _a:
    if i in _b:
        _share.append(i)
print(_share[-c])

Measured memory_bytes: 3064
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <numeric>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<((x))<<endl
#define fi first
#define se second

#define INF 2147483600
#define long long long

vector<string> name;
vector<vector<int> > refs;

void solve(int i, int d){
  rep(j,d) printf(".");
  cout<<name[i]<<endl;
  for(auto to : refs[i]){
    solve(to, d+1);
  }
}

int main(){
  int n;
  cin>>n;
  name.resize(n);
  refs.resize(n);
  rep(i,n){
    int d;
    scanf("%d", &d);
    cin>>name[i];
    if(d>0){
      d--;
      refs[d].pb(i);
    }
  }

  solve(0, 0);

  return 0;
}

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

using namespace std;

typedef long long ll;
#define fi first
#define se second
#define pb push_back

int main() {
    //ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n;
    scanf("%d", &n);
    vector <pair <int, int> > v;
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        v.pb({x, i});
    }
    sort(v.begin(), v.end());
    for (int i = 0; i < n; i++) {
        printf("%d ", v[i].se + 1);
    }
    return 0;
}


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

typedef long long ll;
 
using tpl = tuple<int, int, int>;
typedef pair<int,int> pii;

void fastStream(){cin.tie(0);std::ios_base::sync_with_stdio(0);}

int N, K;
int A[5010];
vector<int> A2;
int dp1[5010][5010];
int dp2[5010][5010];

int main(){

    cin >> N >> K;
    for(int i = 0; i < N; i++) cin >> A[i];
    int ans = 0;
    for(int i = 0; i < N; i++){
        if(A[i] >= K){
            ans++;
        }
        else{
            A2.push_back(A[i]);
        }
    }
    
    // 配るDP
    dp1[0][0] = 1;
    for(int i = 0; i < (int)A2.size(); i++){
        for(int j = 0; j < K; j++){
            dp1[i + 1][j] |= dp1[i][j];
            if(dp1[i][j]){
                dp1[i + 1][min(K, j + A2[i])] |= 1;
            }
        }
    }
    dp2[(int)A2.size()][0] = 1;
    for(int i = (int)A2.size() - 1; i >= 0; i--){
        for(int j = 0; j < K; j++){
            dp2[i][j] |= dp2[i + 1][j];
            if(dp2[i + 1][j]){
                dp2[i][min(K, j + A2[i])] |= 1;
            }
        }
    }

    for(int i = 0; i < (int)A2.size(); i++){
        // [K - A2[i], K - 1] の範囲で値を探す
        int sums[5010] = {};
        for(int j = 0; j < K; j++){
            sums[j + 1] = sums[j] + dp1[i][j];
        }
        for(int j = 0; j < K; j++){
            if(dp2[i + 1][j]){
                // [K - A2[i] - j, K - 1 - j] の範囲で値を探す
                if(sums[K - j] - sums[max(0, K - A2[i] - j)] > 0){
                    ans++;
                    break;
                }
            }
        }
    }
    

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


Measured memory_bytes: 196224
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.rbegin(), cont.rend()
#define unique(a)  (a).erase(unique((a).begin(), (a).end()),(a).end())
#define fastio          ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PB push_back
#define endl "\n"
#define mod 1000000007
typedef long long LL;
#define int long long
typedef long double LD;
typedef vector<int> VI;
inline LL add(LL x, LL y) { x += y; if (x >= mod) x -= mod; return x; }
inline LL moduloMultiplication(LL x, LL y) {
	return (x%mod * 1LL * y%mod) %

		mod;
}
inline LL power(LL a, LL b) {
	LL x = 1 % mod;
	while (b) {
		if (b & 1) x = moduloMultiplication(x, a);
		a = moduloMultiplication(a, a);
		b >>= 1;
	}
	return x % mod;
}

inline LL inv(LL a) { return power(a, mod - 2) % mod; }
LL gcd(LL a, LL b)
{
	if (!a)
		return b % mod;
	return gcd(b%a, a) % mod;
}

signed main()
{
	fastio;
	int i = 1;
	int a, b;
	cin>>a>>b;
	while (1) {
		if (i == 1e6) {
			cout << -1 << endl;
			return 0;
		}
		if (i == 25) {
			//cout << (i*8 )/ 100 << " " << (b == ((i*(1) / 10))) << endl;
		}
		if ((((i * 8) / 100) == a) && (b==((i*(1) / 10)))) {
			cout << i << endl;
			return 0;
		}
		i++;
	}

}



Measured memory_bytes: 256
function main (input) {
    var N = parseInt(input.split(' ')[0],10);
    var A = parseInt(input.split(' ')[1],10);
    var B = parseInt(input.split(' ')[2],10);
    var ans =0;

    for (var n=0;n<=N;n++) {
        var sum =0;
        sum = findSumOfDigits(n);
        if (Math.floor(sum) >= A && Math.floor(sum) <= B) {
            ans = ans + n;
        }
    }
    function findSumOfDigits(n) {
        while (n) {
            sum = sum + n%10;
            n = Math.floor(n/10);
        }
      	//console.log(sum);
        return sum;
    }
    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7500
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<cstdint>
#include<bits/stdc++.h>
#include<queue>
#include<set>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep_r(i, n) for(int i = n-1; i >= 0; i--)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((ll)(x).size())
#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define INF bit(60)
#define pb push_back
#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; }

using namespace std;
using uif=uint_fast64_t;
using ll=long long int;

int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mod;a=1ll*a*a%mod;}while(b>>=1);return ans;}
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


int main(void){

  string s;

  cin>>s;

  ll ans=0;
  ll tmp_a=0;
  //cout << s.size() << endl;
  rep(i,s.size()){  
    if(s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G' ){
      tmp_a++;
    }
    else{
      tmp_a=0;
    }
    //cout << tmp_a << endl;
    if(ans < tmp_a){
      ans=tmp_a;
    }
  }

  cout << ans << endl;

  return 0;

}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

using ll = long long;

void read();
template<typename First, typename... Rest> void read(First& first, Rest&... rest);
void write();
template<typename First, typename... Rest> void write(First first, Rest... rest);
template<typename T> void write_vec(vector<T>& v, char divider);

int main(){
    int N;
    read(N);
    vector<int> t(N + 1);
    vector<int> x(N + 1);
    vector<int> y(N + 1);
    t[0] = 0;
    x[0] = 0;
    y[0] = 0;
    for(int i = 1; i <= N; i++){
        read(t[i], x[i], y[i]);
    }
    string ans = "Yes";
    for(int i = 1; i <= N; i++){
        int dt = t[i] - t[i - 1];
        int dv = abs(x[i] - x[i - 1]) + abs(y[i] - y[i - 1]);
        if(!(dt >= dv && (dt & 1) == (dv & 1))){
            ans = "No";
        }
    }
    write(ans);
    return 0;
}

//配列以外の入力を受け取る
void read(){

}
template<typename First, typename... Rest>
void read(First& first, Rest&... rest){
    cin >> first;
    read(rest...);
}
//
//配列以外を出力する
void write(){

}
template<typename First, typename... Rest>
void write(First first, Rest... rest){
    cout << first << " ";
    write(rest...);
}
//
//配列を区切って出力する
template<typename T>
void write_vec(vector<T>& v, char divider){
    for(size_t i = 0; i < v.size(); i++){
        cout << v[i] << divider;
    }
}
//

Measured memory_bytes: 1408
N,M,K=list(map(int,input().split()))
a_list = list(map(int,input().split()))
b_list = list(map(int,input().split()))
ans = 0
b_sum=[0]
cnt = 0
for i,b in enumerate(b_list):
  b_sum.append(b_sum[i] + b)
  if b_sum[i+1]<=K:
    cnt+=1
    ans=max(ans,cnt)

a_sum=0
for i,a in enumerate(a_list):
  a_sum+=a
  pos = K - a_sum
  books = i+1
  if pos<0:
    break
  
  left = 0
  right = len(b_sum)-1
  while left<=right:
    mid = (left+right)//2

    if b_sum[mid]>pos:
        right = mid - 1
    else:
        left = mid + 1
  books+=right
  ans = max(ans, books)

print(ans)

Measured memory_bytes: 119416
n , k = map(int,input().split())
s = list(input())
if s[k-1] == "A":
    s[k-1] = "a"
elif s[k-1] == "B":
    s[k-1] = "b"
elif s[k-1] == "C":
    s[k-1] = "c"
print("".join(s))

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

long n,k,ans=0,mod=1000000007;

long modpow(long modpow_x,long modpow_y) {
  long modpow_return=1;
  for(long i=1;i<=modpow_y;i*=2) {
    if(modpow_y/i%2==1) modpow_return=modpow_return*modpow_x%mod;
    modpow_x=modpow_x*modpow_x%mod;
  }
  return modpow_return;
}

int main() {
  cin >> n >> k;
  vector<long> a(k);
  for(long i=k;i>0;i--) {
    a[i-1]=modpow(k/i,n);
  }
  for(long i=k;i>0;i--) {
    for(long j=i*2;j<=k;j+=i) {
      a[i-1]=(a[i-1]+mod-a[j-1])%mod;
    }
    ans=(ans+(a[i-1]*i))%mod;
  }

  cout << ans << endl;
}

Measured memory_bytes: 4032
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define For(i,start,end) for(i64 i = start; i < end; i++)
#define newline std::cout<<'\n';
#define newlinedx(num) for(int i=0;i<num;i++)std::cout<<'\n';
using namespace std;
typedef long long ll;
typedef unsigned long ul;

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ui = uint64_t;

//----------------library in this time--------------------------------
template <class T>
T gcd(const T a,const T b) {
    return (b == 0) ? a : gcd (b, a % b);
}
template <class T>
T lcm(const T a, const T b) {
    return a * b / gcd(a,b);
}
template <class T>
inline T ave(const T a, const T b) {
    return (a + b) / 2.0f;
}

long long squareTwo(const long long a,const long long b) {
    return (b == 1) ? a : squareTwo(a * 2, b - 1);
}

template <class T>
inline T Max(const T a,const T b) {
    return (a >= b) ? a : b;
}

template <class T>
inline T Min(const T a,const T b) {
    return (a <= b) ? a : b;
}

template <class T>
inline void show(T a) {
    cout << a << endl;
}

//------------------------main function-------------------------------
void Main(){
    int n; cin >> n;
    vector<char> a(n);
    rep(i, n)cin >> a[i];
    if(n%2!=0){
        cout << "No" << endl;
        return;
    }else{
        rep(i, n/2)if(a[i]!=a[i+n/2]){
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
}

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

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

int main(){
  int N,K,x;
  int s = 0;
  cin >> N >> K;
  for(int i = 0; i < N; i++){
    cin >> x;
    if(x < K - x){
      s += x*2;
    }
    else{
      s += (K-x)*2;
    }
  }
  cout << s << endl;
}

Measured memory_bytes: 256
def kai(x):
	ans = 1
	i=1
	while x>=i:
		ans = ans*i
		i+=1
	return ans
	

def calc(x, l):
	y=len(l)
	a=l[x]
	cnt = 0
	x+=1
	while x < y:
		if l[x] < a:
			cnt+= 1
		x+=1
	return(cnt)

n=int(input())
p = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
p_num=0
q_num=0
for i in range(n):
	p_num += kai(n-i-1)*calc(i,p)
	q_num += kai(n-i-1)*calc(i,q)
	
if p_num < q_num:
	t=p_num
	p_num = q_num
	q_num = t
		
print(p_num-q_num)

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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define itrdebug(x) cerr << #x << " "; for (auto & el : (x)) {cerr << (el) << " ";} cerr << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define debug(x)
#define itrdebug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void solve(long long N, std::vector<long long> A, std::vector<long long> B){
    sort(all(A));
    sort(all(B));
    if (N % 2 == 0) {
        ll min2, max2;
        min2 = A[N/2-1] + A[N/2];
        max2 = B[N/2-1] + B[N/2];
        cout << max2 - min2 + 1 << endl;
    } else {
        ll min = A[N/2];
        ll max = B[N/2];
        cout << max - min + 1 << endl;
    }
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    std::vector<long long> B(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
        scanf("%lld",&B[i]);
    }
    solve(N, std::move(A), std::move(B));
    return 0;
}


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

int main() {
	cin.tie(0);
        ios::sync_with_stdio(false);
	
	int n; cin >> n;
	while(n--){
		int balls[10];
		for(int i = 0; i < 10; i++){
			cin >> balls[i];
		}
		
		bool sortable = false;
		for(int i = 0; i < (1 << 10); i++){
			int bit = i;
			bool ok = true;
			
			int top[2] = {0,0}; //top[0]: B, top[1]: C
			for(int j = 0; j < 10; j++){
				if(top[bit & 1] > balls[j]){
					ok = false; break;
				}
				top[bit & 1] = balls[j];
				bit >>= 1;
			}
			
			if(ok) {
				sortable = true; break;
			}
		}
		
		if(sortable) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

Measured memory_bytes: 1184
#include <stdio.h>
#include <math.h>
int main(){
 int n,d,i,j,k,sum=0,ans=0,x[10][10]={};
 scanf("%d%d",&n,&d);
 for(i=0;i<n;i++)
  for(j=0;j<d;j++)
   scanf("%d",&x[i][j]);
 for(i=0;i<n;i++)
  for(j=i+1;j<n;j++){
   for(k=0;k<d;k++)
    sum+=pow(x[i][k]-x[j][k],2);
   if((int)sqrt(sum)*(int)sqrt(sum)==sum)
    ans++;
   sum=0;
  }
 printf("%d\n",ans);
 return 0;
}

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

int get_digit_sum(int n) {
	int digit_sum = 0;
	while(n > 0) {
		digit_sum += n % 10;
		n /= 10;
	}

	return digit_sum;
}

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

	if (n % get_digit_sum(n) == 0) cout << "Yes" << endl;
	else cout << "No" << endl;

 	return 0;
}

Measured memory_bytes: 256
S = input()

d = {}

for s in S:
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

dv = list(d.values())
if len(dv) == 2 and dv[0] == 2 and dv[1] == 2:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;

	void run() {
		Scanner sc = new Scanner(System.in);
		int a = INF;
		for(int i=0;i<3;i++) a = min(sc.nextInt(), a);
		int b = INF;
		for(int i=0;i<2;i++) b = min(sc.nextInt(), b);
		System.out.println(a+b-50);
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}
}

Measured memory_bytes: 12000
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int H = scan.nextInt();
        int W = scan.nextInt();
        char[][] map = new char[H][W];
        for (int i = 0; i < H; i++) {
            String s = scan.next();
            map[i] = s.toCharArray();
        }
        int limit = H * W;
        int[][] distance = new int[limit][limit];
        for (int i = 0; i < limit; i++) {
            Arrays.fill(distance[i], Integer.MAX_VALUE);
        }
        for (int i = 0; i < H; i++) {
            for (int j = 1; j < W; j++) {
                if (map[i][j-1] == '.'&& map[i][j] == '.') {
                    distance[i * W + j-1][i * W + j] = 1;
                    distance[i * W + j][i * W + j-1] = 1;
                }
            }
        }
        for (int j = 0; j < W; j++) {
            for (int i = 1; i < H; i++) {
                if (map[i-1][j] == '.'&& map[i][j] == '.') {
                    distance[(i -1) * W + j][i * W + j] = 1;
                    distance[i * W + j][(i - 1) * W + j] = 1;
                }
            }
        }
        int[][] min_distance = new int[limit][limit];
        for (int i = 0; i < limit; i++) {
            Arrays.fill(min_distance[i], Integer.MAX_VALUE);
        }
        for (int i = 0; i < limit; i++) {
            for (int j = 0; j < limit; j++) {
                min_distance[i][j] = distance[i][j];
            }
        }
        for (int k = 0; k < limit; k++) {
            for (int i = 0; i < limit; i++) {
                for (int j = 0; j < limit; j++) {
                    if (min_distance[i][k] == Integer.MAX_VALUE) {
                        continue;
                    }
                    if (min_distance[k][j] == Integer.MAX_VALUE) {
                        continue;
                    }
                    min_distance[i][j] = Math.min(min_distance[i][j], min_distance[i][k] + min_distance[k][j]);
                }
            }
        }
        if (limit <= 2) {
            System.out.println(1);
            return;
        }
        int answer = 0;
        for (int i = 0; i < limit; i++) {
            for (int j = 0; j < limit; j++) {
                if (min_distance[i][j] == Integer.MAX_VALUE) {
                    continue;
                }
                answer = Math.max(answer, min_distance[i][j]);
            }
        }
        System.out.println(answer);
    }
    class Position {
        int r = 0;
        int c = 0;
        Position(int r, int c) {
            this.r = r;
            this.c = c;
        }
    }
}


Measured memory_bytes: 29028
#include<stdio.h>
int main() {
	int N;
	scanf("%d", &N);
	int *A = (int *)malloc(sizeof(int)*N);
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &A[i]);
	}

	int ans = 0;
	for (int i = 0; i < N; i++)
	{
		ans++;
		while (A[i] == A[i + 1])  i++; 
		if (A[i] - A[i + 1] <= 0) 
		{
			while (A[i] - A[i + 1] <= 0)  i++; 
		}
		else
		{
			while (A[i] - A[i + 1] >= 0)
				while (A[i] - A[i + 1] >= 0) i++;
		}
	}
	printf("%d\n", ans);

	return 0;
}

Measured memory_bytes: 512
L, R = map(int, input().split())
N = 2019

if R - L > N:
    print(0)
else:
    tmp_i = tmp_j = 0
    num = -1
    for i in range(L, R):
        for j in range(i+1, R+1):
            if num == -1:
                num = i * j % 2019
            else:
                num = min(num, i * j % 2019)
    print(num)

Measured memory_bytes: 3188
fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let a: usize = sc.read();
    let b: usize = sc.read();
    let c: usize = sc.read();
    if a + b + c >= 22 {
        println!("bust");
    } else {
        println!("win");
    }
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


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

// using ll = long long;
#define int long long

#define LOG(variable) cout << #variable":\t" << (variable) << endl
#define LOGCON(i, container) for(int (i) = 0; (i) < (container).size(); ++(i)) cout << (i) << ":\t" << (container)[(i)] << endl
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, r, n) for(int i = (n); i >= (r); --i) // from n to r
#define REPOBJ(itr, obj) for(auto itr = (obj).begin(); itr != (obj).end() ; ++itr)
#define REPROBJ(itr, obj) for(auto itr = (obj).rbegin(), e = (obj).rend(); itr != e; ++itr)
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))
/***** MAIN *****/
signed main() {
  int n, h;
  cin >> n >> h;
  int max_in = 0;
  vector<int> second_power(n);
  for(int i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp >> second_power[i];
    max_in = max(max_in, tmp);
  }
  SORTR(second_power);
  int ans = 0;
  for(int i = 0; i < n; ++i) {
    if(second_power[i] <= max_in) break;
    h-= second_power[i];
    ++ans;
    if(h <= 0) break;
  }
  if(h > 0) {
    if(h%max_in) {
      ans += h / max_in + 1;
    } else {
      ans += h / max_in;
    }
  }
  cout << ans;
  
  cout << "\n";
  return 0;
}
/***** MAIN *****/


Measured memory_bytes: 1024
#include <bits/stdc++.h>
 
using namespace std;
 
int n, ans;
 
int main() {
	scanf("%d", &n);
	for (int i = 3; i <= n; i += 2) {
		int cnt = 0;
		for (int j = 1; j <= i; j++)
			cnt += i % j == 0;
		if (cnt == 8)
			ans++;
	}
	printf("%d\n", ans);
	return 0;
}

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

template<long long mod>
class modint{
private:
  long long a;
public:
  constexpr modint(const long long x = 0) noexcept : a(x%mod) {}
  constexpr long long& value() noexcept { return a; }
  constexpr const long long& value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint& operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if(a >= mod) a -= mod;
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if(a < rhs.a) a += mod;
    a -= rhs.a;
    return *this;
  }
  constexpr modint& operator*=(const modint rhs) noexcept {
    a = a*rhs.a%mod;
    return *this;
  }
  constexpr modint& operator/=(modint rhs) noexcept {
    long long k = mod-2;
    while(k > 0){
      if(k&1){
        *this *= rhs;
      }
      rhs *= rhs;
      k /= 2;
    }
    return *this;
  }
  friend ostream& operator<<(ostream &os, const modint &X){
    return os << X.a;
  }
  friend istream& operator>>(istream &is, modint &X){
    is >> X.a;
    X.a %= mod;
    if(X.a < 0) X.a += mod;
    return is;
  }
};


template<typename T>
struct Combination {
private:
  int sz;
  vector<T> F, F_;
public:
  Combination(int sz) : sz(sz), F(sz+1), F_(sz+1) {
    F[0] = 1;
    for(int i = 0; i < sz; ++i) F[i+1] = F[i]*(i+1);
    F_.back() = (T)1/F.back();
    for(int i = sz-1; i >= 0; --i) F_[i] = F_[i+1]*(i+1);
  }
  T C(int n, int k){
    assert(n <= sz);
    if(n < 0 or k > n) return (T)0;
    return F[n]*F_[k]*F_[n-k];
  }
};

template<typename T>
T power(T x, long long k){
  T ret{1};
  while(k > 0){
    if(k&1) ret *= x;
    x *= x;
    k /= 2;
  }
  return ret;
}

int main(){
  using mint = modint<(int)1e9+7>;
  int K;
  string S;
  cin >> K >> S;
  const int n = S.length();
  mint ans = 0;
  Combination<mint> comb(K+n+1);
  for(int i = 0; i <= K; ++i){
    ans += power<mint>(25,i)*comb.C(n-1+i,i)*power<mint>(26,K-i);
  }
  cout << ans << endl;
}


Measured memory_bytes: 35636
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define f first
#define s second
#define all(container) container.begin(),container.end()
#define fast ios::sync_with_stdio(0); cin.tie(0)
#define int long long
const int mod = 1e9+7;  
int power(int a,int b) { if(b==0) return 1; int res = power(a,b/2); if(b&1) return res * res * a; else return res * res; }


bool isEqual(vector<int>& v1,vector<int>&v2){
  for(int i=0;i<v1.size();i++){
    if(v1[i]!=v2[i]) return false;
  }
  return true;
}


int32_t main(){
    
  fast;
  int n; cin >> n;
  vector<int> v1;
  vector<int> v2;

  vector<int> A(n);
  vector<int> B(n);

  for(int i=0;i<n;i++){
    int x; cin >> x;
    v1.push_back(x);
    A[i] = B[i] = i+1;
  }

  for(int i=0;i<n;i++){
    int x; cin >> x;
    v2.push_back(x);
  }

  int cnt1 = 1;
 
  do{
    if(isEqual(A,v1)){
      break;
    }else{
      cnt1++;
    }
  }while(next_permutation(all(A)));

  int cnt2 = 1;

  do{
    if(isEqual(B,v2)){
      break;
    }else{
      cnt2++;
    }
  }while(next_permutation(all(B)));

  cout << abs(cnt1-cnt2);



  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    int n; cin >> n;
    vi a(n); for(auto& e : a) cin >> e;

    int minval = (int)1e6;
    int res = 0;
    rep(i, n){
        if(a[i] <= minval) res++, minval = a[i];
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m); (i) > (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define R cin>>
#define repr(i, n) REPR(i, n, 0)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define in(a) insert(a)
#define P(p) cout<<(p)<<endl;
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;
template<typename T> void co(T e){cout << e << "\n";}
template<typename T> void co(const vector<T>& v){for(const auto& e : v)
{ cout << e << " "; } cout << "\n";}
ll gcd(ll a, ll b) {
    if (a < b)swap(a, b);
    if (b == 0) return a;
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}
ll lcm(ll a, ll b) {
    ll g = gcd(a, b);
    return a * b / g;
}
bool prime(ll n) {
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n%i == 0)return false;
    }
    return n != 1;
}

Vec fac, finv;

ll PowMod(ll a, ll n){
    if(n == 1) return a;
    if(n%2 == 0) return PowMod(a*a%MOD, n/2);
    return a*PowMod(a*a%MOD, n/2)%MOD;
}

ll combi(ll n, ll k){
    if(k>n) return 0;
    return fac[n]*finv[k]%MOD*finv[n-k]%MOD;
}


int main(){
    int n, d, x;
    R n >> d >> x;
    rep(i, n){
        int a, ret = 1;
        x ++;
        R a;
        while(ret + a <= d){
            ret += a;
            x += 1;
        }
    }
    co(x);
}

Measured memory_bytes: 256