akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define fo(i,a,b)for(int i=a,_e=b;i<=_e;++i)
#define ll long long
using namespace std;
const int N=305;
int n,k,mo,v,f[N][N],f2[N][N];
int main(){
	cin>>n>>k>>mo;
	f2[0][0]=1;
	fo(i,1,n+1){
		f2[i][0]=1;
		fo(j,1,n)
			f2[i][j]=((ll)f2[i][j-1]*i+f2[i-1][j])%mo;
	}
	f[0][1]=1;
	fo(i,1,k){
		fo(j,1,n+1)if(v=f[i-1][j]){
			fo(l,0,n+1-j)
				f[i][j+l]=((ll)v*f2[j][l]+f[i][j+l])%mo;
		}
	}
	cout<<f[k][n+1];
}

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

int main() {
    int a[10], k;
    cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4] >> k;
    for (int i = 0; i < 5; i++) {
        for (int j = i + 1; j < 5; j++) {
            if (a[j] - a[i] > k) {
                cout << ":(" << endl;
                return 0;
            }
        }
    }

    cout << "Yay!" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-15
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N,K;
	ll kosu=0;
	scan(N);scan(K);
	kosu+=(ll)(N/K)*(N/K)*(N/K);
	if(K%2==0){
		ll toori=(ll)(2*N)/K-N/K;;
		kosu+=toori*toori*toori;
	}
	prin(kosu);
	return 0;
}


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

#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
#define ALL(x) x.begin(), x.end()
#define X first
#define Y second
#define ACCEL ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
typedef pair<pll,lli> p3l;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
typedef vector<p3l> v3L;
typedef vector<vcL> vvL;
//typedef priority_queue<T> prior_S<T>;
//typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
      lli   mod = 1000000007;

/// templates ///

const lli maxN = 2E5;

vcL inv(maxN+5, 1);
vcL fac(maxN+5, 1);

void ADD(lli &x, lli y) {
	x += y;
	if (x >= mod) x -= mod;
	if (x < 0) x += mod;
}

void MUL(lli &x, lli y) {
	x *= y;
	x = (x % mod + mod) % mod;
}

lli mypow(lli b, lli e) {
	lli ans = 1;
	while (e) {
		if (e & 1) MUL(ans, b);
		MUL(b, b);
		e >>= 1;
	}
	return ans;
}

lli modinv(lli n) {
	return mypow(n, mod - 2);
}

void calcInv(lli n) {
	for (int i = 2; i <= n; ++i) {
		inv[i] = (mod - mod / i) * inv[mod % i] % mod;
	}
}

void calcFac(lli n) {
	for (int i = 2; i <= n; ++i) {
		fac[i] = fac[i - 1] * i % mod;
	}
}

lli cm(lli a, lli b) {
	lli ans = 1;
	if (a < b) return 0;

	MUL(ans, inv[fac[a - b]]);
	MUL(ans, inv[fac[b]]);
	MUL(ans, fac[a]);

	return ans;
}

lli Lucas(lli n, lli m) {
	if (m == 0) return 1;
	return cm(n % mod, m % mod) * Lucas(n / mod, m / mod) % mod;
}

lli doLucas(lli n, lli m) {
	calcInv(mod);
	calcFac(mod);
	return Lucas(n, m);
}

/// coding area ///

const lli maxn = 1E5;

void precal() {

	return;
}

void solve() {
	lli k, x;
	cin >> k >> x;
	for (int i = x-k+1; i <= x+k-1; ++i) {
		cout << i << ' ';
	}
	cout << '\n';
}

int main() {
	precal();
	int t = 1;
	#ifdef LOCAL
		t = INT_MAX;
	#else
		ACCEL;
	#endif
//	cin >> t;
	for (int i = 1; i <= t; ++i) {
//		printf("Case #%d: ", i );
		solve();
	}
	return 0;
}



Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(), v.end()

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

int main(){
    int N, M, X; cin >> N >> M >> X;
    vector<queue<int>> S((1 << N));
    for (int bit = 0; bit < (1 << N); bit++)
    {
        for (int i = 0; i < N; i++)
        {
            if (bit & (1 << i)) S.at(bit).push(i);
        }
        
    }
    int c_a[12][13];
    

    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j <= M; j++)
        {
            cin >> c_a[i][j];
        }
        
    }
    int b = 10000000;
    for (auto x: S){
        int a = 0;
        vector<int> Y(M);
        while (!x.empty())
        {   
            int u = x.front();x.pop();
            a += c_a[u][0];
            for (int i = 0; i < M; i++)
            {
                Y.at(i) += c_a[u][i + 1];
            }
            
        }
        bool flag = true;
        for (int i = 0; i < M; i++)
        {
            if (Y.at(i) < X) flag = false;
        }
        
        if (flag){
            if (b > a) b = a;
        }
        
    }
    if (b == 10000000) cout << -1 << endl;
    else cout << b << endl;
}

Measured memory_bytes: 6176
import java.io.IOException;
import java.io.OutputStream;

public class Main{
	public static void main(String[] args)throws IOException{
		Print p = new Print();
		
		for(int i = 1; i <= 9; i++){
			for(int j = 1; j <= 9; j++){
				p.print((i + "x" + j + "=" + i * j + "\n").getBytes());
			}
		}
	}
}

class Print{
	private final OutputStream op = System.out;
	
	public void print(byte buffer[])throws IOException{
		op.write(buffer);
		op.flush();
	}
}

Measured memory_bytes: 24004
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); ++i)
#define FOR(i, s, n) for(int i=(int)(s); i<(int)(n); ++i)
#define ALL(n) (n).begin(), (n).end()
#define pb push_back

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> mat;

const ll MAX_V = 100000;
const ll INF = 1e9;
const ll MOD = 998244353;

int main(){
    string s; cin >> s;
    bool ok = false;
    int l, r;
    REP(i, s.size()-2){
        if (s[i] == s[i+1]){
            l = i + 1;
            r = i + 2;
            ok = true;
            break;
        }
        if (s[i] == s[i+2]){
            l = i + 1;
            r = i + 3;
            ok = true;
            break;
        }
    }
    if (s[s.size()-2] == s[s.size()-1]){
        ok = true;
        l = s.size() - 1;
        r = s.size();
    }
    if (ok) cout << l << " " << r << endl;
    else cout << "-1 -1" << endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
#define INF 2147483647
using namespace std;
using Graph=vector<vector<int>>;

int main(){
  ll a,v,b,w,t;
  cin>>a>>v>>b>>w>>t;
  ll x=abs(a-b);
  if(v*t>=x+t*w){
    cout<<"YES";
  }else{
    cout<<"NO";
  }
}

Measured memory_bytes: 3596
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

class Solver {
public:
	static void solve() {
		int n;
		cin >> n;
		vector<int> res;
		while (n > 0) {
			vector<string> s;
			for (int i = 0; i < n; i++) {
				string c;
				cin >> c;
				s.push_back(c);
			}			
			res.push_back(DFS(s));
			cin >> n;
		}

		for (int i = 0; i < res.size(); i++)cout << res[i] << endl;
	}

	static int DFS(vector<string> s) {
		if (s[0][0] == '+')	s.push_back(".0");
		else if (s[0][0] == '*') s.push_back(".1");
		else return s[0][0] - '0';

		int val = s[0][0] == '+' ? 0 : 1;
		vector<string> sTemp;
		for (int i = 1; i < s.size(); i++) {
			if (s[i][0] == '.'
				&& s[i][1]!='.') {
				if (s[0][0] == '+') {
					if (sTemp.size() > 0)val += DFS(sTemp);
				}
				else {
					if (sTemp.size() > 0)val *= DFS(sTemp);
				}
				sTemp.clear();
			}
			sTemp.push_back(s[i].substr(1, s[i].size() - 1));
		}

		return val;
	}
};

int main() {
	Solver::solve();
}


Measured memory_bytes: 3096
/************************************************
 * Au: Hany01
 * Date: Aug 16th, 2018
 * Prob: AGC003E
 * Email: hany01@foxmail.com
 * Inst: Yali High School
************************************************/
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define For(i, j, k) for (register int i = (j), i##_end_ = (k); i <= i##_end_; ++ i)
#define Fordown(i, j, k) for (register int i = (j), i##_end_ = (k); i >= i##_end_; -- i)
inline LL read() {
	static LL _, __; static char c_;
    for (_ = 0, __ = 1, c_ = getchar(); c_ < '0' || c_ > '9'; c_ = getchar()) if (c_ == '-') __ = -1;
    for ( ; c_ >= '0' && c_ <= '9'; c_ = getchar()) _ = (_ << 1) + (_ << 3) + (c_ ^ 48);
    return _ * __;
}
const int maxn = 1e5 + 5;
LL a[maxn], sm[maxn], c[maxn], t;
int n, N, m, p;
int main()
{
#ifdef hany01
	freopen("agc003e.in", "r", stdin);
	freopen("agc003e.out", "w", stdout);
#endif
	for (N = a[n = 1] = read(), m = read(); m --; ) {
		for (t = read(); n && t <= a[n]; -- n);
		a[++ n] = t;
	}
	sm[n] = 1;
	Fordown(i, n - 1, 1) for (sm[i] += a[i + 1] / a[i] * sm[i + 1], t = a[i + 1] % a[i]; t; )
		if (p = upper_bound(a + 1, a + 1 + n, t) - a - 1) sm[p] += (t / a[p]) * sm[i + 1], t %= a[p]; else c[t] += sm[i + 1], t = 0;
	c[a[1]] += sm[1];
	Fordown(i, N, 1) c[i] += c[i + 1];
	For(i, 1, N) printf("%lld\n", c[i]);
	return 0;
}

Measured memory_bytes: 4096
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

#include <bits/stdc++.h>
using namespace std;

int main() { 
  int h,w;
  while(cin>>h>>w){
    if(h==0 && w==0) return 0;
  
    rep(j,w) cout<<'#';
    cout<<endl;
    rep(i,h-2){
      cout<<'#';
      rep(j,w-2) cout<<'.';
      cout<<'#'<<endl;
    }
    rep(j,w) cout<<'#';
    cout<<endl;
    
    cout<<endl;
  }
  
  return 0;
}


Measured memory_bytes: 3084
#include<stdio.h>
int main(){
  int n,i,j,count=0;
  int a[11][11];
  for(i=0;i<10;i++)
    for(j=0;j<10;j++)
      a[i][j]=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    j=i;
    while(j/10!=0)
      j/=10;
    a[j][i%10]++;
  }
  for(i=1;i<=9;i++){
    for(j=i;j<=9;j++){
      if(i==j)
        count+=a[i][j]*a[i][j];
      else
        count+=2*a[i][j]*a[j][i];
    }
  }
  printf("%d\n",count);
  return 0;
}


Measured memory_bytes: 128
import java.io.*;
import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;

public class Main
{	
	public static void main(String []args)throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		
		//long X=Long.parseLong(br.readLine());
		String []s=br.readLine().split(" ");
		/*long X=Long.parseLong(s[0]);
		long N=Long.parseLong(s[1]);
		long C=Long.parseLong(s[2]);
		long K=Long.parseLong(s[3]);*/
		int X=Integer.parseInt(s[0]);
		int N=Integer.parseInt(s[1]);
		
		
		
		/*int a[][]=new int[N+1][N+1]; //you can use a set instead of array
		int ht[]=new int[N+1];
		boolean flag=false;*/
		//String ans="";
		
		int ans=0, mindiff=Integer.MAX_VALUE, diff=0;
		
		HashSet<Integer> h= new HashSet<Integer>();
		s=br.readLine().split(" ");
		
		for(int i=0;i<N;i++)
			h.add(Integer.parseInt(s[i]));
			
		for(int i=0;i<=101;i++)
		{
			if(!h.contains(i))
			{
				diff= abs(X-i);
				if(diff<mindiff)
				{
					mindiff=diff;
					ans=i;
				}
			}
		}
		
			//ans = flag==true? "Yes" : "No";
		
		out.println(ans);
		
	}
	
	
}




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

    int main(){
    	long long n,k;
    	cin>>n>>k;
    	long long x[n];
    	long long res = 1000000000,cnt = 0;
    	for(long long i=0;i<n;i++){
    		cin>>x[i];
    		cnt = max(cnt,x[i]);
    	}
    	if(x[0]>=0){
    		//全部プラス
    		res = x[k-1];
    	}else if(cnt <= 0){
    		//全部マイナス
    		res = abs(x[(n-k)]);
    	}else{
    		for(long long i=0;i<(n-k+1);i++){
    			res = min(res,min(abs(x[i])+abs(x[i]-x[i+k-1]),abs(x[i+k-1])+abs(x[i+k-1]-x[i])));
    			//cout<<"i:"<<i<<"res:"<<res<<endl;
    		}
    	}

    	cout<<res<<endl;

    }


Measured memory_bytes: 1024
#include <iostream>
#include <string.h>
#include <map>
#include <iomanip>
#include <vector>
#include <set>
#include <queue>
#include <cmath>
#include <algorithm>
#define pb push_back
#define mk make_pair
#define ll long long
#define fast ios_base::sync_with_stdio(false);
using namespace std;
int main()
{
	ll int h,cnt=0,s=1,sum=0;
	cin>>h;
	while(h>0)
	{
		
		
		sum+=s;
		h=h/2;
		s*=2;
		cnt++;
	}
	cout<<sum;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
using namespace std;

using ll = long long;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int INF = 1e9;
const long long INFL = 1LL<<60;

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

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

  vector<vector<int>> d(n, vector<int>(n, INF));
  rep(i, m) {
    int s, t, c;
    cin >> s >> t >> c;
    d[s][t] = c;
  }

  vector<vector<int>> dp(1<<n, vector<int>(n, INF));
  dp[(1<<n) - 1][0] = 0;

  for (int s = (1<<n) - 2; s >= 0; s--) {
    for (int v = 0; v < n; v++) {
      for (int u = 0; u < n; u++) {
        if (!(s >> u & 1)) {
          dp[s][v] = min(dp[s][v], dp[s | 1 << u][u] + d[v][u]);
        }
      }
    }
  }

  if (dp[0][0] == INF) {
    cout << -1 << endl;
  } else {
    cout << dp[0][0] << endl;
  }

  return 0;
}



Measured memory_bytes: 6228
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, k = map(int, input().split())
p_list = list(map(int, input().split()))
score = []
for p in p_list:
    score.append((p + 1) / 2)

max_score = 0
flag = 0
total_score = 0
for i in range(n):
    if i < k - 1:
        total_score += score[i]
    else:
        total_score += score[i]
        max_score = max(max_score, total_score)
        total_score -= score[i - k + 1]
print(max_score)

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

int main() {
  int n,a,b;cin>>n>>a>>b;
      int cnt=0;
  for(int i=1;i<=n;i++){
    int c=i,ans=0;
    while(c){
      ans+=c%10;
      c/=10;
    }
    if(a<=ans&&ans<=b)cnt+=i;
  }
  cout<<cnt<<endl;
}

Measured memory_bytes: 3592
package main

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

const modd int = 1000000007

func main() {
	scanInit()

	n := nextInt()

	ans := powMOD(10, n) - (powMOD(9, n) + powMOD(9, n) - powMOD(8, n))

	ans %= modd
	fmt.Println((ans + modd) % modd)

}
func powMOD(a, b int) int {
	var ret int = 1
	for b > 0 {
		if (b & 1) == 1 {
			ret *= a
			ret %= modd
		}
		a = a * a % modd
		b >>= 1
	}
	return ret
}

// ---- readfunc
var sc = bufio.NewScanner(os.Stdin)

func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1780
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

static int dp[3010][3010];
const int inf = (int)1e9;

int solve(int n, int t, int s, vector<int> &a, vector<int> &b)
{
if(t < 0)
return -inf;
if(n < 0)
return 0;
if(dp[n][t] != -1)
return dp[n][t];
int ans = 0;
int temp;

temp = solve(n - 1, t, s, a, b);
ans = max(temp, ans);
bool cross = s < t && t - b[n] < s;
if(cross)
temp = solve(n, s, s, a, b);
else
temp = solve(n - 1, t - b[n], s, a, b) + a[n];
ans = max(temp, ans);
return dp[n][t] = ans;
}

int main()
{
int n, t, s;
vector<int> a, b;
scanf("%d%d%d", &n, &t, &s);
a.resize(n);
b.resize(n);
for(int i = 0; i < n; ++i)
scanf("%d%d", &a[i], &b[i]);
fill(dp[0], dp[3010], -1);
int ans = solve(n - 1, t, s, a, b);
printf("%d\n", ans);
return 0;
}

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

int main(){
  string s;
  cin >> s;
  sort(s.begin(),s.end());
  int n = s.size();
  rep(i,n-1){
    if(s[i] == s[i+1]){
      puts("no");
      return 0;
    }
  }
  puts("yes");
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
void bulk(){}template<class H,class...T>void bulk(H&h,T&...t){cin>>h;bulk(t...);}
#define rep(i,n) for(int i=0;i<n;i++)
#define all(i) i.begin(),i.end()
int main(void){
    // Your code here!
    int n,f=0;
    cin>>n;
    int m=n;
    while(m){
        f+=m%10;
        m/=10;
    }
    if(n%f==0)cout<<"Yes";else cout<<"No";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define N 300005
#define M 1000000007
#define pii pair<ll,ll>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
main()
{
    ll n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    if(a[0]==0)
    {
        cout<<0;
        return 0;
    }
    ll mx=1e18;
    ll ans=1;
    for(int i=0;i<n;i++)
    {
        ll now=mx/ans;
        if(a[i]>now)
        {
            cout<<-1;
            return 0;
        }
        ans*=a[i];
    }
    cout<<ans;
}



Measured memory_bytes: 4416
use proconio::input;
//use proconio::marker::{Bytes, Chars};

// x ** n % mods を求める
pub fn mod_pow(x: i64, n: i64, mods: i64) -> i64 {
    if n == 0 {
        return 1;
    }
    let mut res = mod_pow(x * x % mods, n / 2, mods);
    if n % 2 == 1 {
        res = res * x % mods;
    }
    return res;
}

// (1/n) % mods を求める
pub fn mod_inv(n: i64, mods: i64) -> i64 {
    return mod_pow(n, mods-2, mods);
}

// nCk % mods を求める
pub fn mod_comb(n: i64, k: i64, mods: i64) -> i64 {
    let sum1 = (n-k+1..n+1).fold(1, |ac, x| ac * x % mods);
    let sum2 = (1..k+1).fold(1, |ac, x| ac * x % mods);
    return sum1 * mod_inv(sum2, mods) % mods;
}

// nCk の組み合わせを列挙する
pub fn combination(n: usize, k: usize) -> Vec<Vec<usize>> {
    let mut ans = Vec::new();
    if k == 1 {
        for i in 1..n+1 {
            let mut tmp = Vec::new();
            tmp.push(i);
            ans.push(tmp);
        }
    }
    else {
        for iter in combination(n-1, k-1) {
            let max = iter.iter().max().unwrap();
            for j in *max+1..n+1 {
                let mut tmp = iter.clone();
                tmp.push(j);
                ans.push(tmp);
            }
        }
    }
    ans
}

fn main() {
    input!{
        n: usize,
        m: usize,
        k: usize,
        a1: [usize; n],
        b1: [usize; m],
    }
    let mut a = vec![0];
    let mut b = vec![0];
    for i in 0..n {
        a.push(a[i]+a1[i]);
    }
    for i in 0..m {
        b.push(b[i]+b1[i]);
    }
    let mut ans = 0;
    let mut maxj = m;
    for i in 0..n+1 {
        for j in (0..maxj+1).rev() {
            if a[i] + b[j] <= k {
                if i + j > ans {
                    ans = i + j;
                }
                maxj = j;
                break;
            }
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 12688
///////////////////////////////////////////////
//		 ©Ahmad Haulian Yoga Pratama		 //
//          SMA TARUNA NUSANTARA		     //
//                MAGELANG					 //
//				   157503 					 //
// 		   	 All Right Reserved				 //
///////////////////////////////////////////////

#include<bits/stdc++.h>
using namespace std;
#define scanint(n) scanf("%d",&n)
#define scanll(n) scanf("%lld",&n)
#define mp make_pair
#define pb push_back
#define s second
#define f first
#define pii pair<int,int>
#define reset(a,b) memset(a,b,sizeof a)
#define ll long long
#define MAXAND 0x7fffffff
#define MOD 1000000007
#define lch(x) (2*x)
#define rch(x) (2*x+1)
#define MID (l+r)/2
#define ALL(x) x.begin(),x.end()
#define dalam fl<=l && r<=fr
#define kiwo lch(idx),l,MID
#define tengen rch(idx),MID+1,r
/*
template <class T> void inp(T &N){
    char ch;
    int sign = 1;
    while(ch = getchar_unlocked(), isspace(ch)) {

    };
    N = 0;
    if(ch == '-')
        sign = -1;
    else N = ch - '0';
    while(ch = getchar_unlocked(), isdigit(ch))
        N = (N << 3) + (N << 1) + ch - '0';
    N *= sign;
}
*/
string ss;
int main(){
	cin>>ss;
	for(int i=0;i<ss.size();i++){
		if(i==3)cout<<8;
		else cout<<ss[i];
	}
	cout<<endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<vector>
#include<array>
#include<string>
#include<stack>
#include<queue>
#include<algorithm>
#include<cassert>
#include<functional>
#include<random>
#include<complex>
#include<bitset>
#include<chrono>
//#include<boost/multiprecision/cpp_int.hpp>
#define int int64_t
#define uint uint64_t
#define REP(i, a, b) for (int64_t i = (int64_t)(a); i < (int64_t)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (auto x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define Min(x) *min_element(ALL(x))
#define Max(x) *max_element(ALL(x))
#define Unique(L) (L.erase(unique(ALL(L)), L.end()))
#define veccat(v1, v2) std::copy((v2).begin(),(v2).end(),std::back_inserter(v1)/*v1の後ろにv2を入れる*/)
#define intmax (std::numeric_limits<int64_t>::max() / 4)
using namespace std;
//typedef boost::multiprecision::cpp_int bigint;
const double EPS = 1e-9;
const double PI = acos(-1.0);



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

	int N, M;
	cin >> N >> M;

	vector<int>card(100001);
	rep(i, N) {
		int X;
		cin >> X;
		card[X]++;
	}
	int ans = 0;

	vector<int>pair_modM(M);
	rep(i, 100001) {
		pair_modM[i%M] += card[i] / 2;
		ans += card[i] / 2;
		card[i] %= 2;
	}

	vector<int>card_modM(M);
	rep(i, 100001)if (card[i]) {
		card_modM[i%M]++;
	}
	
	ans += card_modM[0] / 2;
	card_modM[0] %= 2;
	if (M % 2 == 0) {
		ans += card_modM[M / 2] / 2;
		card_modM[M / 2] %= 2;
	}
	REP(i, 1, M) {
		if (M <= i * 2)break;
		const int mmm = min(card_modM[i], card_modM[M - i]);
		ans += mmm;
		card_modM[i] -= mmm;
		card_modM[M - i] -= mmm;
	}

	rep(i, M) {
		if (2 <= card_modM[i]) {
			if (pair_modM[M - i]) {
				const int mmm = min(pair_modM[M - i], card_modM[i] / 2);
				ans += mmm;
				pair_modM[M - i] -= mmm;
				card_modM[i] -= mmm * 2;

			}
		}
	}


	cout << ans << endl;
}

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

int main(void){

    char S[100];
    int Len = 0;
    int f = 0;

    scanf("%s", S);
    Len = strlen(S);

    for (int i = 0; i < (Len / 2); i++){
        if (S[i] != S[Len - i - 1]) {
            f++;
        }
    }

    printf("%d", f);

    return 0;
}

Measured memory_bytes: 128
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

//ABC176C
int main(void) {
  long long n, k, i, cou=0, tmp;
  scanf("%lld", &n);
  long long a[n];
  scanf("%lld", &a[0]);
  for(i=1; i<n; i++){
    scanf("%lld", &a[i]);
    if(a[i]<a[i-1]) cou+=a[i-1]-a[i], a[i]=a[i-1];
  }
  printf("%lld", cou);
  return 0;
}

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

long long L;
int N;
vector<long long> X;

long long Dist(int Left, int Right) {
	if (Left <= Right) {
		return X[Right] - X[Left];
	}
	else {
		return X[Right] + L - X[Left];
	}
}

int main() {
	cin >> L >> N;
	X.resize(N + 2);
	X[0] = 0, X[N + 1] = L;
	for (int i = 1; i <= N; i++) cin >> X[i];
	long long NOW = 0, MAX = 0;
	int LP = 0, RP = N, LM = N, RM = N;
	for (int i = 0; i < N * 2; i++) {
		NOW += Dist(LP, RP);
		NOW -= Dist(LM, RM);
		if (i % 2 == 0) LP == 0 ? LP = N : LP--;
		RP == 0 ? RP = N : RP--;
		LM == 0 ? LM = N : LM--;
		if (i % 2 == 1) RM == 0 ? RM = N : RM--;
		MAX = max(MAX, NOW);
	}
	cout << MAX << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg puts("It's Just Begining.Wait For The End!!!!!\n")
#define CHECK(x) cout << (#x) << " is " << (x) <<"\n";
#define endl printf("\n")
typedef pair<ll,ll> pii;
#define pb push_back
#define ms(a,b) memset(a, b, sizeof(a))
#define in(x) scanf("%lld",&x)
#define out(x) printf("%lld",x)
#define X first
#define Y second
#define sps printf(" ")
#define dou(x) cout<<fixed<<setprecision(6)<<x
#define all(v) v.begin(),v.end()
#define dis(it,it1) distance(it,it1)+1
#define MAX 100005
#define INF 9223372036854775807LL
#define MOD 1000000007
#define print(cs) printf("Case %lld: ",cs)
#define Yesno(ok) if(ok)puts("YES");else puts("NO")
#define yesno(ok) if(ok)puts("Yes");else puts("No")
ll lcm(ll a,ll b){return ((a*b)/__gcd(a,b));}
vector<ll>adj[MAX];
bool vis[MAX];
ll level[MAX],ans[MAX];
void bfs()
{
    ms(level,-1);
    level[1]=0;
    vis[1]=true;
    ll i,j,k,l,n,m,r;
    queue<ll>pq;
    pq.push(1LL);
    while(!pq.empty())
    {
        n=pq.front();
        pq.pop();
        for(i=0;i<adj[n].size();i++)
        {
            m=adj[n][i];
            if(level[m]==-1||level[m]>level[n]+1)
            {
                level[m]=level[n]+1;
                ans[m]=n;
            }
            if(!vis[m])
            {
                vis[m]=true;
                pq.push(m);
            }
        }
    }
}
int main()
{
    ll i,j,k,l,n,m;
    in(n);in(m);
    ll u,v;
    ms(vis,false);
    for(i=0;i<m;i++)
    {
        in(u);in(v);
        adj[u].pb(v);
        adj[v].pb(u);
    }
    bfs();
    bool ok=true;
    for(i=2;i<=n;i++)
    {
        if(level[i]==-1)
        {
            ok=false;
            break;
        }
    }
    if(!ok)
    {
        puts("No");
        return 0;
    }
    puts("Yes");
    for(i=2;i<=n;i++){out(ans[i]);endl;}
}


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

int main() {
  long n,m,k,ans=0,x=0,y;
  cin >> n >> m >> k;
  y=m;
  vector<long> a(n);
  vector<long> b(m+1);
  for(long i=0;i<n;i++) cin >> a[i];
  for(long i=1;i<=m;i++) cin >> b[i];

  for(long i=1;i<=m;i++) b[i]+=b[i-1];
  for(long i=0;i<=n;i++) {
    if(i!=0) x+=a[i-1];
    if(x>k) break;
    while(x+b[y]>k) y--;
    ans=max(ans,i+y);
  }
  cout << ans << endl;
}

Measured memory_bytes: 6420
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f first
#define s second


int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n=1e6;
    vector<int> is_prime(n+1, 1);
    is_prime[0] = is_prime[1] = 1;
   for (int i = 2; i * i <= n; i++) {
    if (is_prime[i]==1) {
         for (int j = i * i; j <= n; j += i){
         	if(is_prime[j]==1)
         	 is_prime[j] = i;
		 }
       }
    }
    
    int m;
    cin>>m;
    
    int a[m];
    map<int,int> ma;
    bool f= false;
    for(int i=0;i<m;i++){
    	cin>>a[i];
    	vector<int> p;
    	int x=a[i];
    	while(is_prime[x]!=1){
    	    p.push_back(is_prime[x]);
    	    x=x/is_prime[x];
		}
		if(x!=1){
			p.push_back(x);
		}
	    p.resize(unique(p.begin(),p.end())-p.begin());
		for(int j=0;j<p.size();j++){
			if(ma[p[j]]){
				f=true;
			}
			++ma[p[j]];
		}
	}
	
	if(!f){
		cout<<"pairwise coprime\n";
		return 0;
	}
	
	int gc = a[0];
	for(int i=1;i<m;i++){
		gc=__gcd(gc, a[i]);
	}
	if(gc==1){
		cout<<"setwise coprime\n";
	}else{
		cout<<"not coprime\n";
	}
	return 0;
}

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



using namespace std;

int main()
{
	int64_t a, b;
	double b_syousuu;
	cin >> a >> b_syousuu;
	b = b_syousuu * 100 + 0.5;
	cout << a * b / 100 << endl;
	return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long int
#define mod 1000000007
#define all(x) (x).begin(),(x).end()
 
#define REP(i, n) for(int i = 0; i < (n); i++)
#define NREP(i, n) for(int i = 1; i <= (n); i++)
#define SREP(i, s) for(int i = 0; i < (s.size()); i++)
#define SORT(v, n) sort(v, v+n);
#define GSORT(v, n) sort(v, v+n, greater<int>());
#define VSORT(v) sort(v.begin(),v.end());
#define VGSORT(v) sort(v.begin(),v.end(),greater<int>());
#define REV(a) reverse(begin(a),end(a));

int nums(int n){
	return to_string(n).length();
}
int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	cout << fixed << setprecision(7);
////////////////////////////////////////////
	int n,k;
	cin >> n >> k;
	bool bb = true;
	int count=0;
	while(bb){
		if(pow(k,count)>n) bb=false;
		count++;
	}
	cout << count-1 << endl;

	
///////////////////////////////////////////
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define int long long
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<< ": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  const int N = 200005;


int32_t main()
{


    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS


    int n;
    cin >> n;
    vector<int> v(n+1);

    for(int i = 1; i <= n; i++)
    {
      cin >> v[i];
    }
    vector<bool> vis(n+1,false);

  

    int ans = 0;

    for(int i = 1; i <= n; i++)
    {
      if(!vis[i] and !vis[v[i]] and v[v[i]] == i)
      {
        vis[i] = true;
        vis[v[i]] = true;
        ans++;
      }
    }
    

    cout << ans;
    return 0; 
}


Measured memory_bytes: 3976
import collections
import numpy
n = int(input())
x = []
def factorization(n):
    d = []
    while n % 2 == 0:
        d.append(2)
        n /= 2
    f = 3
    while f*f <= n:
        if n % f == 0:
            d.append(int(f))
            n /= f
        else:
            f += 2
    if n != 1:
        d.append(n)
    return d

for i in range(n, 1, -1):
    x += factorization(i)

c = collections.Counter(x)
l = list(c.values())
ans = 1

for i in range(len(l)):
    ans *= 1 + l[i]

print(ans % (7+10**9))

Measured memory_bytes: 27184
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int n = saori.saori_hayami();
		int a = saori.saori_hayami();
		int b = saori.saori_hayami();
		if(a*n <= b){
			System.out.println(a*n);
		} else {
			System.out.println(b);
		}
		
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 21332
INF=10**6
f=lambda:map(int,input().split())
h,w=f()
ch,cw=f()
dh,dw=f()
g=[input() for _ in range(h)]
d=[[INF]*w for _ in range(h)]
d[ch-1][cw-1]=0
from collections import *
q=deque([(0,ch-1,cw-1)])
while q:
  td,tx,ty=q.popleft()
  if d[tx][ty]<td: continue
  for dx,dy in [(1,0),(0,1),(-1,0),(0,-1)]:
    nx,ny=tx+dx,ty+dy
    if 0<=nx<h and 0<=ny<w and g[nx][ny]=='.' and d[nx][ny]>td:
      d[nx][ny]=td
      q.appendleft((td,nx,ny))
  for dx in range(-2,3):
    for dy in range(-2,3):
      nx,ny=tx+dx,ty+dy
      if 0<=nx<h and 0<=ny<w and g[nx][ny]=='.' and d[nx][ny]>td+1:
        d[nx][ny]=td+1
        q.append((td+1,nx,ny))
a=d[dh-1][dw-1]
print([-1,a][a<INF])

Measured memory_bytes: 101112
#define y1 askjdkasldjlkasd
#include <bits/stdc++.h>
#undef y1

using namespace std;

#define pb push_back
#define mp make_pair
#define fi(a, b) for(int i=a; i<=b; i++)
#define fj(a, b) for(int j=a; j<=b; j++)
#define fo(a, b) for(int o=a; o<=b; o++)
#define fdi(a, b) for(int i=a; i>=b; i--)
#define fdj(a, b) for(int j=a; j>=b; j--)
#define fdo(a, b) for(int o=a; o>=b; o--)
#define sz(x) (int)x.size()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<ll> vll;

#ifdef LOCAL
#define err(...) fprintf(stderr, __VA_ARGS__)
#else
#define err(...) while (0)
#endif

double START_TIME;

void exit() {
#ifdef LOCAL	
	cerr << "TIME: " << setprecision(5) << fixed << (clock() - START_TIME) / CLOCKS_PER_SEC << endl;
#endif	
	exit(0);
}

template<typename A, typename B>
ostream& operator<<(ostream& os, pair<A, B> p) {
	os << "(" << p.first << ", " << p.second << ")";
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, vector<T> v) {
	fi(0, sz(v) - 1) {
		os << v[i] << " ";
	}
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, set<T> t) {
	for (auto z : t) {
		os << z << " ";
	}
	return os;
}

template<typename T1, typename T2>
ostream& operator<<(ostream& os, map<T1, T2> t) {
	cerr << endl;
	for (auto z : t) {
		os << "\t" << z.first << " -> " << z.second << endl;
	}
	return os;
}

#ifdef LOCAL
#define dbg(x) {cerr << __LINE__ << "\t" << #x << ": " << x << endl;}
#define dbg0(x, n) {cerr << __LINE__ << "\t" << #x << ": "; for (int ABC = 0; ABC < n; ABC++) cerr << x[ABC] << ' '; cerr << endl;}
#else
#define dbg(x) while(0){}
#define dbg0(x, n) while(0){}
#endif

#ifdef LOCAL
#define ass(x) if (!(x)) { cerr << __LINE__ << "\tassertion failed: " << #x << endl, abort(); }
#else
#define ass(x) assert(x)
#endif

///////////////////////////////////////////////////

const int MAX = 1e6 + 41;
const int MOD = 998244353;

int add(int a, int b) {
	a += b;
	if (a >= MOD) a -= MOD;
	return a;
}

int sub(int a, int b) {
	a -= b;
	if (a < 0) a += MOD;
	return a;
}

int mul(int a, int b) {
	return (ll) a * b % MOD;
}

int bp(int x, int d) {
	int res = 1;
	while (d) {
		if (d & 1) res = mul(res, x);
		x = mul(x, x);
		d >>= 1;
	}
	return res;
}

int inv(int x) {
	return bp(x, MOD - 2);
}

int n;
int a[MAX];
int sum[MAX];
int f[MAX];

void solve () {
	fi(0, n - 1) sum[a[i]] = add(sum[a[i]], a[i]);
	fi(1, MAX - 1) {
		for (int j = i + i; j < MAX; j += i) {
			sum[i] = add(sum[i], sum[j]);
		}
	}	
	fdi(MAX - 1, 1) {
		f[i] = mul(sum[i], sum[i]);
		//f[i] = mul(f[i], inv(i));
		for (int j = i + i; j < MAX; j += i) {
			f[i] = sub(f[i], mul(j, f[j]));
		}
		f[i] = mul(f[i], inv(i));
	}
	dbg0(sum, 10);
	dbg0(f, 10);

	int ans = 0;
	fi(1, MAX - 1) ans = add(ans, f[i]);
	fi(0, n - 1) ans = sub(ans, a[i]);
	ans = mul(ans, inv(2));
	printf("%d\n", ans);
}

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	START_TIME = (double)clock();
#endif
	
	scanf("%d", &n);
	fi(0, n - 1) scanf("%d", &a[i]);
	solve();

	exit();
	return 0;
}





Measured memory_bytes: 10496
#include <bits/stdc++.h>
#define mset(a, b) memset(a, b, sizeof(a))
#define mcpy(a, b) memcpy(a, b, sizeof(a))
#define rg register
using namespace std;
typedef long long LL;
const int MAXN = 200005;
const int MOD = 998244353;

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

int n, ok[MAXN], f[MAXN], ans;
char s[MAXN], t[MAXN];

inline void Inc(int &x, int y) {
	x += y; if (x >= MOD) x -= MOD;
}

inline void Dec(int &x, int y) {
	x -= y; if (x < 0) x += MOD;
}

inline int Mul(int x, int y) {
	return 1LL * x * y % MOD;
}

inline int Calc(int x) {
	int ret = 0;
	for (int i = 1; i <= x; ++i) {
		ret = (ret * 2 + s[i] - '0') % MOD;
	}
	for (int i = 1, j = 1; i <= n; ++i, j = (j == x * 2)? 1 : (j + 1)) {
		t[i] = (j <= x)? s[j] : (s[j - x] ^ 1);
	}
	for (int i = 1; i <= n; ++i) {
		if (s[i] > t[i]) return ret + 1;
		if (s[i] < t[i]) return ret;
	}
	return ret + 1;
}

void init() {
	read(n);
	scanf("%s", s + 1);
}

void solve() {
	for (int i = 1; i <= n; ++i) {
		ok[i] = (n % i == 0 && (n / i) % 2 == 1);
	}
	ans = Mul(Calc(n), n * 2);
	for (int i = n - 1; i >= 1; --i) {
		if (!ok[i]) continue;
		int tmp = n * 2;
		for (int j = i; j <= n; j += i) {
			Inc(tmp, f[j]);
		}
		f[i] = i * 2;
		Dec(f[i], tmp);
		Inc(ans, Mul(Calc(i), f[i]));
	}
	printf("%d\n", ans);
}

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


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

public class Main{

	static int N,M;
	static int[][] idol;
	static int[][] dp=new int[301][301];;
	static int ability;
	public static void main(String[] args) {
		Scanner cin=new Scanner(System.in);
		for(;cin.hasNext();){
			String NM=cin.nextLine();
			N=Integer.parseInt(NM.substring(0,NM.indexOf(' ')));
			M=Integer.parseInt(NM.substring(NM.indexOf(' ')+1));
			idol=new int[N][4];
			
			for(int i=0;i<N;i++){
				cin.nextLine();
				String cc=cin.nextLine();
				for(int j=0;j<3;j++){
					idol[i][j]=Integer.parseInt(cc.substring(0,cc.indexOf(" ")));
					cc=cc.substring(cc.indexOf(" ")+1);
				}
				idol[i][3]=Integer.parseInt(cc);
			}
			int ans=0;
			for(int i=1;i<=3;i++){
				
				for(int j=0;j<301;j++){
					Arrays.fill(dp[j], -1);
				}
				ability=i;
				ans=Math.max(ans,dp(0,M));
			}
			System.out.println(ans);
		}
	}
	static int dp(int a,int b){
//		System.out.println(a+" "+b+" "+rank);
		if(b==0)return 0;
		if(a==N){
			return 0;
		}
		if(dp[a][b]>=0)return dp[a][b];
		int re=0;
		for(int i=0;idol[a][0]*i<=b;i++){
			re=Math.max(re, dp(a+1,b-idol[a][0]*i)+idol[a][ability]*i);
			                                               
		}
		return dp[a][b]=re;
	}
}

Measured memory_bytes: 126868
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define END << endl;
#define SP << " " << 
using namespace std;

int T[205];
int main(){
	int n1,n2,h,m;
	cin>>n1;
	REP(i,n1){
		cin>>h>>m;
		T[i]=h*60+m;
	}
	cin>>n2;
	for(int i=n1;i<n1+n2;i++){
		cin>>h>>m;
		T[i]=h*60+m;
	}
	sort(T,T+n1+n2);
	REP(i,n1+n2){
		if(i){
			if(T[i]==T[i-1]) continue;
			else{
					if(T[i]%60<10){
						cout<<" "<<T[i]/60<<":0"<<T[i]%60;
					}
					else cout<<" "<<T[i]/60<<":"<<T[i]%60;
				}
		}
		else{
			if(T[i]%60<10){
				cout<<T[i]/60<<":0"<<T[i]%60;
			}
			else cout<<T[i]/60<<":"<<T[i]%60;
		}
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 3148
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def main():
    N = NI()
    A = NLI()
    nowRGB = [0, 0, 0]
    ans = 1
    for a in A:
        ans *= nowRGB.count(a) % MOD
        for i in range(3):
            if nowRGB[i] == a:
                nowRGB[i] += 1
                break

    print(ans%MOD)



if __name__ == "__main__":
    main()

Measured memory_bytes: 14348
def divisor(n):
  ass=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      ass.append(i)
      if i!=n//i:ass.append(n//i)
  return ass
_,k=map(int,input().split())
a=list(map(int,input().split()))
for ans in sorted(divisor(sum(a)))[::-1]:
  b=[i%ans for i in a if i%ans]
  n=len(b)
  b.sort()
  m=[0]+[i for i in b]
  p=[ans-i for i in b]+[0]
  for i in range(n):
    m[i+1]+=m[i]
    p[-i-2]+=p[-i-1]
  flag=False
  for i in range(n+1):
    if max(m[i],p[i])>k:continue
    if abs(m[i]-p[i])%ans!=0:continue
    flag=True
  if flag:print(ans);exit()

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

int main(){
  int n, l;
  cin >> n >> l;
  vector<int> an(n);
  int last = -1;
  for(int i=0; i<n; ++i){
    cin >> an[i];
    if(i != 0 && an[i] + an[i-1] >= l) last = i;
  }
  if(last == -1){
    cout << "Impossible" << endl;
    return 0;
  }
  --last;
  cout << "Possible" << endl;
  for(int i=0; i<last; ++i) printf("%d\n",i+1);
  for(int i=n-2; i>=last; --i) printf("%d\n",i+1);
}

Measured memory_bytes: 3788
def main():
    N = int(input())
    T = []
    for i in range(N):
        a, b = map(int, input().split())
        T.append((a, b))
    T.sort(key=lambda x: x[1])
    p = 0
    fail = False
    for i in range(N):
        p += T[i][0]
        if p > T[i][1]:
            fail = True
    print('No' if fail else 'Yes')

if __name__ == '__main__':
    main()


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

using namespace std;

#define PB push_back
#define MP make_pair
#define f first
#define s second
#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define RFOR(i, b, a) for (int i = b-1; i>=a; --i)
#define FILL(a, b) memset(a, b, sizeof a)
#define ALL(a) a.begin(), a.end()
#define SZ(a) ((int)a.size())
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = 1LL * INF*INF;
const int MAX = 1e5 + 7;
const double PI = acos(-1.);
const double EPS = 1e-8;
const int MOD = 998244353;

int main()
{
	ios_base::sync_with_stdio(0);
	int n, a, b;
	cin >> n >> a >> b;
	VI x(n);
	int p = 0, q = 0, t = 0;
	FOR(i, 0, n)
	{
		cin >> x[i];
		if (x[i] <= a)
		{
			++p;
		}
		if (x[i] > a && x[i] <= b)
		{
			++q;
		}
		if (x[i] > b)
		{
			++t;
		}
	}

	cout << min({t, p, q});

	return 0;
}


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

int main() {
    int N;
    cin >> N;
    
    int remainder = N % 1000;
    if (remainder != 0){
        cout << 1000 - remainder << endl;
    }
    else
    {
        cout << 0 << endl;
    }
}

Measured memory_bytes: 3616
d[25],i,W,g;
//M(int*a){return*1[&a]-*a;}
M(int*a,int*b){return*b-*a;}
main(n){
	for(;scanf("%d",&n),n;){
		for(i=n;i--;){
			int m,w;
			scanf("%d%d",&m,&w);
			d[i]=w*999+m;
		}
		qsort(d,n,4,M);
		W=g=0;
		for(i=n;i--;){
			W+=d[i]%999;
			if(W>d[i]/999)
				g=1;
		}
		puts(g?"No":"Yes");
	}
	exit(0);
}

Measured memory_bytes: 0
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    int[] juice = new int[n];
    int ans = 0;
    
    for(int i = 0;i < n; i++){
      juice[i] = sc.nextInt();
    }
    
    Arrays.sort(juice);
    
    for(int i = 0;i < k; i++){
      ans += juice[i];
    }
      System.out.println(ans);
    
  }  
}

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

int main(){
	int m,f,r;
	while(cin >> m >> f >> r){
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1) cout << "F" << "\n";
		else if(m + f>=80) cout << "A" << "\n";
		else if(m + f>=65 && m + f<=80) cout << "B" << "\n";
		else if(m + f>=50 && m + f<=65 ) cout << "C" << "\n";
		else if(m + f>=30 && m + f<=50){
			if(r>=50) cout << "C" << "\n";
			else cout << "D" << "\n";

		} 
		else cout << "F" << "\n";

	}
	return 0;
}

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

#define rr(i, b)    for (int i = 0; i < int(b); i++)
#define vi(n, a) vector <int> a(n); rr(i, n) cin >> a[i]
#define pvec(a) rr(i, a.size()) cout << a[i] << " "; cout << endl
#define bug(x) cout << #x << " " << x << endl
#define ll long long
#define vii vector <int>

using namespace std;

ll mod = 1e9 + 7;

void solve() {
    ll n;
    cin >> n;

    ll t = 1;
    ll nine = 1;
    ll eight = 1;
    
    for(int i = 0; i < n; i++) {
        t = (t * 10) % mod;
        nine = (nine * 9) % mod;
        eight = (eight * 8) % mod;
    }

    ll res = ((t - (2 * nine) % mod + eight) + mod) % mod;

    cout << res << endl;
}
 
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    solve();
    return 0;
}

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

int main() {
  int A, B, C, K;
  cin >> A >> B >> C >> K;
  if(K <= A){
   cout << K << endl;
  }
  else if(K <= A + B){
   cout << A << endl;
  }
  else{
   cout << A-(K-A-B);
  }
}


Measured memory_bytes: 3628