akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb             push_back
#define conv(a)        bitset<30>(a).to_string() ;
#define mxpq           priority_queue <int>
#define mnpq           priority_queue<int,vector<int>,greater<int>>
#define S(v)           sort(v.begin(),v.end())
#define RS(v)          sort(v.rbegin(),v.rend())
#define R(v)           reverse(v.begin(),v.end())
#define print          printf("%.16f\n", ans)
#define inf            LLONG_MAX
#define mini           LLONG_MIN
#define T              int tc;cin>>tc;while(tc--)
#define MSET(tabl,i)   memset(tabl, i, sizeof(tabl))
#define int            long long 
#define MAXN           10000001
#define M              1000000007
#define fio            cin.sync_with_stdio(false) ; cin.tie(0);cout.tie(0) ;
#define endl           "\n"
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> Set;

vector<pair<int,int>> primefactors(int n) 
 {     
     vector<pair<int,int>> ans ;
      if(n%2==0)
    {
        ans.pb({2,0}) ;
    }
    while (n%2 == 0) 
    {   
        n = n/2; 
        ans[ans.size()-1].second++ ;
    } 
    for (int i = 3; i <= sqrt(n); i = i+2) 
    { 
        if(n%i==0)
        {
            ans.pb({i,0}) ;
        }
        while (n%i == 0) 
        { 
            n = n/i; 
            ans[ans.size()-1].second++ ;
        } 
    } 
    if (n > 2) 
    {
        ans.pb({n,0}) ;
        ans[ans.size()-1].second++ ;
    }
    return ans ;
}
void Xarr(){
     
       int n ; cin>>n ;
       if(n==1){
            cout<<0<<endl ;
            return ;
       }
       vector<pair<int,int>> pf=primefactors(n) ;
       int ans=0 ;
       for(int i=0;i<pf.size();i++){
             int r=pf[i].second ;
             for(int j=1;;j++){
                  if((j*(j+1))/2>r){
                       ans=ans+j-1 ;
                       break ;
                  }
             }
       } 
       cout<<ans<<endl ;
} 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
int32_t main(){
 
    cout<<fixed<<setprecision(16);
    cin.sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
 
    #ifndef ONLINE_JUDGE
     freopen("input.txt",  "r",  stdin);
     freopen("output.txt", "w", stdout);
    #endif
    
    cout << setprecision(9) << fixed;
     clock_t z = clock();
     
     Xarr();
     cerr << "Run Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);
 
     return 0;

}

Measured memory_bytes: 3832
from itertools import product

n,m = list(map(int,input().split()))
swi = []

for _ in range(m):
    k, *sss = list(map(int,input().split()))
    swi.append(sss)
ppp = list(map(int,input().split()))

ans = 0
sta = product((0, 1), repeat=n)

for st in sta:
    flg = True
    for i in range(m):
        cnt = 0
        for j in swi[i]:
            if st[j - 1] == 1:
                cnt += 1
        if cnt % 2 != ppp[i]:
            flg = False
    if flg:
        ans += 1
print(ans)


Measured memory_bytes: 3064
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		// 出力
      if ((a>0 &&a<10) && (b>0 && b<10)){
		System.out.println(a*b);
      }else{
		System.out.println("-1");
      }
   }
}



Measured memory_bytes: 22868
using System;

namespace AtCoder
{
    internal static class Program
    {
        private static void Main()
        {
            int[] ab = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            string text = Console.ReadLine();
            string res = "Yes";
            
            for (int i = 0; i < ab[0]; i++)
                if (!char.IsDigit(text[i]))
                    res = "No";

            if (text[ab[0]] != '-')
                res = "No";

            for (int i = ab[0] + 1; i < ab[0] + ab[1] + 1; i++)
                if (!char.IsDigit(text[i]))
                    res = "No";
            

            Console.WriteLine(res);
        }
    }
}

Measured memory_bytes: 11092
#include<iostream>
#define MAX 100
using namespace std;
int main(){
	string s[MAX];
	int a,b;
	cin>>a>>b;
	for(int i=0;i<a;i++){
		cin>>s[i];
	}
	for(int i=0;i<b+2;i++){
		cout<<'#';
	}
	cout<<endl;
	for(int i=0;i<a;i++){
		cout<<'#'<<s[i]<<'#'<<endl;
	}
	for(int i=0;i<b+2;i++){
		cout<<'#';
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;
const int N = 2e5 + 10;
const int mod = 1e9 + 7;
int m, n, k;
int a[N], b[N];
int mina = 1e9, minb = 1e9, ans = 1e9;
int main()
{
    scanf("%d%d%d", &n, &m, &k);
    for (int i = 1; i <= n; i++)
        scanf("%d", &a[i]), mina = min(mina, a[i]);
    for (int i = 1; i <= m; i++)
        scanf("%d", &b[i]), minb = min(minb, b[i]);
    for (int i = 1; i <= k; i++)
    {
        int x, y, c;
        scanf("%d%d%d", &x, &y, &c);
        ans = min(a[x] + b[y] - c, ans);
    }
    ans = min(ans, mina + minb);
    printf("%d\n", ans);
}

Measured memory_bytes: 1024
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn input_vec() -> Vec<i64> {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn main() {
    let n: i64 = input();
    let mut a_vec = input_vec();
    let mut negative_nums = 0;
    for a in &a_vec {
        if *a == 0 {
            negative_nums = 0;
            break;
        } else if *a < 0 {
            negative_nums += 1;
        }        
    }
    let mut sum = 0;
    if negative_nums % 2 == 0 {
        for a in a_vec  {
            sum += a.abs();
        }
    } else {
        let mut min = std::i64::MAX;
        for a in &a_vec {
            sum += a.abs();
            if a.abs() < min {
                min = a.abs();
            }
        }
        sum -= min * 2;
    }
    println!("{}", sum);
}


Measured memory_bytes: 8444
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main(void)
{
  char word[11];
  char text[1001];
  int i;
  int cnt = 0;

  scanf("%s", word);

  for(i = 0; i < strlen(word); i++)
    word[i] = tolower(word[i]);

  while(1) {
      scanf(" %s", text);
      
      if (strcmp(text, "END_OF_TEXT") == 0)
	break;

      for(i = 0; i < strlen(text); i++)
	text[i] = tolower(text[i]);
      
      if (strcmp(text, word) == 0)
	cnt++;
  }

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

  return 0;
}

Measured memory_bytes: 552
// Devarshi

/*
We will not return to the countless mistakes of the past
I will not relive the failures of the man I once was

Only through dedication will I destroy all preconception

No longer will I let myself be truly satisfied with the standard
We will not return to the countless mistakes of the past

Only through dedication will I destroy all preconception

Let this be
Be the day
Day of my
My declaration
Let this be the day of my declaration

Join me,
Walk with me

Shatter the bonds that tie us
To what we strive to never be

Join me,
Walk with me
*/
#include<bits/stdc++.h>

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

const int maxn=1000001;


int main(){

int n,k;
cin>>n>>k;
if(n%k==0) cout<<0;
else cout<<1;

return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
typedef pair<int,pair<int, int>> P1;

using Graph = vector<vector<int>>;

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

  int N, T;
  cin >> N >> T;
  int A[N];
  rep(i,N) cin >> A[i];
  int mini = INF;
  int profit = 0;
  int count = 0;
  rep(i,N){
    if(mini > A[i]){
      mini = A[i];
    }
    else{
      if(profit < A[i] - mini){
        profit = A[i] - mini;
        count = 1;
      }
      else if(profit == A[i] - mini){
        ++count;
      }
    }
  }
  cout << count << endl;

}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define full(a) a.begin(),a.end()
#define rfull(a) a.rbegin(),a.rend()

using namespace std;
const double pi=acos(-1.0);
const double pii=2*pi;
const double eps=1e-6;
const long long MOD=1e9+7;

void solve(){
    long long n,k,ans;
    cin>>n>>k;
    ans=max(n,k);
    if(n<=k){
        ans=min(n,k-n);
    }
    else{
        n=n%k;
        ans=min(n,k-n);
    }
    cout<<ans<<"\n";
}

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

    solve();
    return 0;
}

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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  
  int n, L, qq;
  cin >> n;
  vector<int> x(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  cin >> L >> qq;

  const int K = 20;
  vector<vector<int>> next(n, vector<int>(K));
  for (int i = 0, j = 0; i < n; i++) {
    while (j + 1 < n && x[j + 1] - x[i] <= L) j++;
    next[i][0] = j;
  }
  for (int j = 1; j < K; j++) {
    for (int i = 0; i < n; i++) {
      next[i][j] = next[next[i][j - 1]][j - 1];
    }
  }

  while (qq--) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    if (a > b) swap(a, b);
    int ans = 0;
    for (int i = K - 1; i >= 0; i--) {
      if (next[a][i] < b) {
        a = next[a][i];
        ans += (1 << i);
      }
    }
    cout << ans + 1 << '\n';
  }

  return 0;
}


Measured memory_bytes: 15404
import sys
import numpy as np
from scipy.misc import comb
sys.setrecursionlimit(1000000)
 
n = int(input())

a = [int(input()) for i in range(n)]

sort_a = sorted(a,reverse=True)

max_a = sort_a[0]
sec_a = sort_a[1]

for i in range(n):
    if a[i] == max_a:
        print(sec_a)
    else:
        print(max_a)

Measured memory_bytes: 24700
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>
 
using namespace std;
 
#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

#define X real()
#define Y imag()
typedef complex<double> P;

int main(){
	
	string s;
	while(cin>>s){
		string str="";
		rep(i,s.size()){
			if(s[i]=='@'){
				int cnt=(s[i+1]-'0');
				rep(j,cnt)str+=s[i+2];
				i+=2;
			}else{
				str+=s[i];
			}
		}
		cout<<str<<endl;
	}
	
}

Measured memory_bytes: 1192
//swing

//Beautiful Strings 

//atcoder_beginner_044_b


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){
	string b;
	cin>>b;
	if(b.length()==1){
      cout<<"No";
      return 0;
    }
	else{
		sort(b.begin(),b.end());
		int cnt=1;
		for(int i=0;i<b.length()-1;i++){
			if(b[i]==b[i+1]){
				cnt=cnt+1;
			}
			else{
				if(cnt%2!=0){
					cout<<"No";
					return 0;
				}
				else{
					cnt=1;
				}
			}
		}
	}

	cout<<"Yes";



}

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

int main()
{
    long long int l,r;
    cin >> l >> r;

    long long int ans = 2018;
    long long int maxNum = min(l+2018, r);
    for(long long int i = l; i < maxNum; ++i)
    {
        for(long long int j = i+1; j <= maxNum; ++j)
        {
            ans = min(ans, i*j%2019);
            if(ans == 0)
            {
                break;
            }
        }
        if(ans == 0)
        {
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop
import copy

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


num_lane,num_info = map(int,input().split())
Q = []
for _ in range(num_lane):
    Q.append(deque())

for _ in range(num_info):
    command,value = map(int,input().split())
    if command == 0:
        value -= 1
        print("%d"%(Q[value].popleft()))
    else:
        min_car = BIG_NUM
        min_lane = BIG_NUM
        for i in range(num_lane):
            if len(Q[i]) < min_car:
                min_car = len(Q[i])
                min_lane = i
        Q[min_lane].append(value)




Measured memory_bytes: 6692
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INTINF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	int ans = 0;
	int tmp;
	int n;
	cin >> n;
	vector<int> h(n+1);
	REP1(i, n) cin >> h[i];
	h[0] = 0;
	REP1(i, 100){
		REP1(j, n){
			if(h[j-1] < i && h[j] >= i) ans ++;
		}
	}
	cout << ans << endl;
}

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

int main() {
  int n;
  cin >> n;
  for (int i=1; i<=n; i++) {
      if (i%3==0 || i%10==3) cout << " " << i ;
      else {
        int j=i;
          while(j!=0) {
              j/=10;
              if (j%10==3) {
                  cout << " " << i;
                  break;
              }
          }
      }
  }
  cout << endl;
}


Measured memory_bytes: 3116
while True:
    n, x = map(int, input().split())
    ans = 0
    if n + x == 0:
        break
    for i in range(n):
        for j in range(i+1,n):
            for k in range(j+1,n):
                if i + j + k + 3 == x:
                    ans += 1
    print(ans)



Measured memory_bytes: 5596
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const long long oo = 1e18;
int n, a[N];
long long s[N], part[2][2][2];
long long sum(int l, int r) {
	return s[r] - s[l - 1];
}
void calc(int l, int r, int id) {
	int lo = l, hi = r, mid, bs = lo;
	long long needVal = sum(l, r) / 2;
	while (lo <= hi) {
		//cerr << lo << ' ' << hi << '\n';
		mid = (lo + hi) / 2;
		if (sum(l, mid) <= needVal) {
			bs = mid;
			lo = mid + 1;
		} else hi = mid - 1;
	}
	part[id][0][0] = sum(l, bs);
	part[id][0][1] = sum(bs + 1, r);
	if (bs + 1 == r) bs --;
	part[id][1][0] = sum(l, bs + 1);
	part[id][1][1] = sum(bs + 2, r);
}
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++ i) {
		scanf("%d", &a[i]);
		s[i] = s[i - 1] + a[i];
	}
	long long res = (long long) 1e18;
	// cerr << res << "\n";
	for (int i = 2; i <= n - 2; ++ i) {
		calc(1, i, 0);
		calc(i + 1, n, 1);
		//cerr << "done\n";
		for (int x = 0; x <= 1; x ++) {
			for (int y = 0 ; y <= 1; y ++) {
				long long Min = oo, Max = - oo;
				Min = min(min(part[0][x][0], part[0][x][1]), min(part[1][y][0], part[1][y][1]));
				Max = max(max(part[0][x][0], part[0][x][1]), max(part[1][y][0], part[1][y][1]));
				res = min(res, Max - Min);
				//cerr << Min << ' ' << Max << "\n";
			}
		}
	}
	printf("%lld", res);
}
// long long maxMinPart(int l, int r, int parts) {
// 	if (parts == 1) return s[r] - s[l-1];
// 	else {
// 		res = - oo;
// 		for (int k = l; k < r; ++ k) {
// 			for (int partsLeft = 1; partsLeft < parts; ++ partsLeft) {
// 				res = max(res, min(maxMinPart(l, k, partsLeft), maxMinPart(k + 1, r, parts - partsLeft)));
// 			}
// 		}
// 	}
// }
// int maxMinPart(int l, int r) {
// 	int lo = r, hi = r, mid, bs = lo;
// 	long long needVal = (s[r] - s[l - 1] + 1) / 2;
// 	while (lo <= hi) {
// 		mid = (lo + hi) / 2;
// 		if (s[mid] - s[lo - 1] <= needVal) {
// 			bs = mid;
// 			lo = mid + 1;
// 		} else hi = mid - 1;
// 	}
// 	return min(s[bs] - s[lo - 1], s[hi] - s[bs]);
// }


Measured memory_bytes: 2560
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}

fn main () {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let n: i32 = sc.read();
    let i: i32 = sc.read();

    println!("{}", n-i+1);
}


Measured memory_bytes: 4352
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int[] abc = new int[3];
		abc[0] = sc.nextInt();
		abc[1] = sc.nextInt();
		abc[2] = sc.nextInt();
		Arrays.sort(abc);
		
		// 計算
		int result = 0;
		int r = abc[2] - abc[1];
		result += r;
		abc[0] += r;
		if((abc[2]-abc[0])%2 == 0){
		    result += (abc[2]-abc[0])/2;
		}else{
		    result += (abc[2]-abc[0])/2 + 2;
		}
		
		
		// 出力
		System.out.println(result);
		
		
	}

}




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

int main() {
  int N,M,Q;
  cin >> N >> M >> Q;
  vector<vector<int>> mp(N,vector<int>(N,0));
  vector<vector<int>> to(N,vector<int>(N,0));
  int l,r;
  for (int i=0; i<M; i++) {
    cin >> l >> r;
    mp[l-1][r-1]++;
  }
  to[0][0] = mp[0][0];
  for (int i=0; i<N; i++) {
    for (int j=1; j<N; j++) {
      to[i][j] = to[i][j-1] + mp[i][j];
    }
  }
  
  int ans;
  for (int i=0; i<Q; i++) {
    ans = 0;
    cin >> l >> r;
    l--;
    r--;
    for (int j=l; j<r+1; j++) {
      ans += to[j][r];
    }
    cout << ans << endl;
  }
  return 0;
}

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

int main(){
	string str;
	getline(cin,str,'\n');
	string ret = "";
	REP(i, str.size()) ret += ('a' <= str[i] && str[i] <= 'z') ? str[i] - 'a' + 'A' : str[i];
	cout << ret << endl;
}

Measured memory_bytes: 1184
#include<stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(a==1){a=14;}
if(b==1){b=14;}
if(a<b){printf("Bob\n");}
if(a==b){printf("Draw\n");}
if(a>b){printf("Alice\n");}
return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define lout cout
#else
stringstream devnull;
#define lout devnull
#endif
template <class C>
inline void vcin(C &a);
template <class C>
inline void vcout(const C a, const string separate = "\n");

int main()
{
  const int P = 1000000007;
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vcin(a);

  vector<int> c(n + 1 + 2, -1);
  for (int i = 0; i < m; i++)
  {
    c[a[i] + 2] = 0;
  }
  c[-1 + 2] = 0;
  c[0 + 2] = 1;
  for (int i = 1 + 2; i <= n + 2; i++)
    if (c[i] != 0)
    {
      c[i] = (c[i - 1] % P + c[i - 2] % P) % P;
    }

#ifdef LOCAL
  vcout(c);
  cout << endl;
#endif
  cout << c[n + 2] << endl;

  return 0;
}

template <class C>
inline void vcin(C &c)
{
  for (auto &a : c)
  {
    cin >> a;
  }
}
template <class C>
inline void vcout(const C c, const string separate)
{
  for (auto it = c.begin(); it != c.end(); it++)
  {
    if (it != c.begin())
      cout << separate;
    cout << *it;
  }
}


Measured memory_bytes: 1024
using System;

namespace AtCoderProblems
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string str = Console.ReadLine();
            int best = 0;
            int count = 0;

            for(int i = 0; i < str.Length; i++)
            {
                if(str[i] == 'R')
                {
                    count++;
                    if(best<count)
                    {
                        best = count;
                    }
                }
                else
                {
                    count = 0;
                }
            }
            Console.WriteLine(best);
        }
    }

}

Measured memory_bytes: 25932
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.TreeSet;
 
 
 
public class Main {
  public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);
 
 
    String str = sc.nextStr();
 
    int batsucount = 0;
    for(int i = 0; i < str.length(); i++){
      if(str.charAt(i) == 'x'){
        batsucount++;
      }
    }
 
    if(batsucount < 8){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
 
  }
 
 //ここからテンプレ
  static class InputReader {
      private InputStream stream;
      private byte[] buf = new byte[1024];
      private int curChar;
      private int numChars;
      private SpaceCharFilter filter;
 
      public InputReader(InputStream stream) {
          this.stream = stream;
      }
 
      public int next() {
          if (numChars == -1)
              throw new InputMismatchException();
          if (curChar >= numChars) {
              curChar = 0;
              try {
                  numChars = stream.read(buf);
              } catch (IOException e) {
                  throw new InputMismatchException();
              }
              if (numChars <= 0)
                  return -1;
          }
          return buf[curChar++];
      }
 
      public String nextStr() {
        int c = next();
        while(isSpaceChar(c)){c = next();}
        StringBuffer str = new StringBuffer();
        do{
          str.append((char)c);
          c = next();
        }while(!isSpaceChar(c));
        return str.toString();
      }
 
      public char nextChar() {
        int c = next();
        while(isSpaceChar(c)){c = next();}
        char ret;
        do{
          ret = (char)c;
          c = next();
        }while(!isSpaceChar(c));
        return ret;
      }
 
      public int nextInt() {
          int c = next();
          while (isSpaceChar(c))
              c = next();
          int sgn = 1;
          if (c == '-') {
              sgn = -1;
              c = next();
          }
          int res = 0;
          do {
              if (c < '0' || c > '9')
                  throw new InputMismatchException();
              res *= 10;
              res += c - '0';
              c = next();
          } while (!isSpaceChar(c));
          return res * sgn;
      }
 
      public boolean isSpaceChar(int c) {
          if (filter != null)
              return filter.isSpaceChar(c);
          return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
      }
 
      public interface SpaceCharFilter {
          public boolean isSpaceChar(int ch);
      }
  }
}

Measured memory_bytes: 22612
//Keep Working Hard
  // I__Like__Food  
  #include<bits/stdc++.h>
  #include <ext/pb_ds/assoc_container.hpp> 
  #include <ext/pb_ds/tree_policy.hpp>
  #define rep(i,a,b) for(int i = a; i <=b; i++)
  #define rep2(i,a,b) for(int i = a; i>=b; i--)
  #pragma GCC optimize("O3")
  #pragma GCC optimize("Ofast") 
  #pragma GCC optimize("unroll-loops")
  using namespace std;
  using namespace __gnu_pbds;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define int long long
  #define all(v) v.begin(),v.end()
  #define PB push_back
  #define MP make_pair
  #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 mod = 1e9 + 7;
  const int N = 200005;
  const int INF = 1e16;
  const double PI = acos(-1);


int32_t main()
{
       

    IOS




    int k,n;
    cin >> k >> n;


  int arr[n+1];



  for(int i = 1; i <=n; i++)
  {
    cin >> arr[i];
  }


  vector<int> v;

  for(int i = 2; i <=n; i++)
  {
    v.PB(arr[i]-arr[i-1]);
  }

  v.PB(arr[1] + k - arr[n]);


  int sum = 0;
  for(auto i : v)
  {
   // cout << i << " ";
    sum += i;
  }  


  int ans = sum;


  for(auto i : v)
  {
    ans = min(ans,sum-i);
  }


  cout << ans;

  return 0;
} 

Measured memory_bytes: 3956
{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import           Control.Monad               (forM, forM_, when)
import           Control.Monad.ST            (ST, runST)
import qualified Data.ByteString.Char8       as BC
import           Data.Maybe                  (fromJust)
import qualified Data.Vector.Unboxed.Mutable as VM

main :: IO ()
main = do
  [n, m] <- readInts <$> BC.getLine
  ps <- readInts <$> BC.getLine
  xys <- readIntss <$> BC.getContents
  print $ solve n m ps xys

solve :: Int -> Int -> [Int] -> [[Int]] -> Int
solve n m ps xys = runST $ do
  uf <- consUF n
  forM_ xys $ \([x, y]) ->
    unite (x - 1) (y - 1) uf
  fs <- forM (zip ps [1 .. n]) $ \(p, q) ->
    find (p - 1) (q - 1) uf
  return . length $ filter id fs

consUF :: Int -> ST s (VM.STVector s Int)
consUF n = VM.replicate n (-1)

unite :: Int -> Int -> VM.STVector s Int -> ST s Bool
unite i j uf = do
  ri <- root i uf
  rj <- root j uf
  when (ri /= rj) (updateUF ri rj uf)
  return $ ri /= rj

updateUF :: Int -> Int -> VM.STVector s Int -> ST s ()
updateUF i j uf = do
  x <- VM.read uf i
  y <- VM.read uf j
  let (i', j') = if x <= y then (i, j) else (j, i)
  VM.write uf i' $ x + y
  VM.write uf j' i'

find :: Int -> Int -> VM.STVector s Int -> ST s Bool
find i j uf = (==) <$> root i uf <*> root j uf

root :: Int -> VM.STVector s Int -> ST s Int
root i uf = do
  x <- VM.read uf i
  if x < 0
    then return i
    else do
      y <- root x uf
      VM.write uf i y
      return y

readInt :: BC.ByteString -> Int
readInt = fst . fromJust . BC.readInt

readInts :: BC.ByteString -> [Int]
readInts = map readInt . BC.words

readIntss :: BC.ByteString -> [[Int]]
readIntss = map readInts . BC.lines


Measured memory_bytes: 19452
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

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

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

int n, k;
vector<vector<int>> G(2000);
vector<bool> visited(2000);

void dfs(int cv, int pv, int depth){
    if(k / 2 < depth) return ;

    visited[cv] = true;
    for(auto nv : G[cv]){
        if(nv == pv) continue;
        dfs(nv, cv, depth + 1);
    }

    return ;
}

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

    cin>>n>>k;
    vector<P> edge;
    for(int i=0; i<n-1; i++){
        int a, b; cin>>a>>b;
        a--, b--;
        G[a].emplace_back(b);
        G[b].emplace_back(a);
        edge.emplace_back(a, b);
    }

    int ans = inf;
    if(k % 2 == 0){
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                visited[j] = false;
            }

            dfs(i, -1, 0);

            int cnt = 0;
            for(int j=0; j<n; j++){
                cnt += (!visited[j]);
            }
            chmin(ans, cnt);
        }
    }
    else{
        for(int i=0; i<n-1; i++){
            int u, v;
            tie(u, v) = edge[i];

            for(int j=0; j<n; j++){
                visited[j] = false;
            }

            dfs(u, -1, 0);
            dfs(v, -1, 0);
            
            int cnt = 0;
            for(int j=0; j<n; j++){
                cnt += (!visited[j]);
            }
            chmin(ans, cnt);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ll n,k,s;
    cin >> n >> k >> s;
    if(k == 0){
        if(s > n){
            for(ll i = 0;i < n;i++){
                cout << 1 << " ";
            }
            cout << endl;
        }
        else{
            for(ll i = 0;i < n;i++){
                cout << s+1 << " ";
            }
            cout << endl;
        }
    }
    else{
        if(s == 1e9){
            for(ll i = 0;i < k;i++){
                cout << s << " ";
            }
            for(ll i = 0;i < n-k;i++){
                cout << 1 << " ";
            }
            cout << endl;
        }
        else{
            for(ll i = 0;i < k;i++){
                cout << s << " ";
            }
            for(ll i = 0;i < n-k;i++){
                cout << s+1 << " ";
            }
            cout << endl;
        }
    }
}

Measured memory_bytes: 1280
import itertools
n = int(input())
a = ''.join(input().split())
b = ''.join(input().split())

perm = list(itertools.permutations( list(str(i) for i in range(1, n+1)) ))
perm = list(map(''.join, perm))

print( abs(perm.index(a) - perm.index(b)))

Measured memory_bytes: 10868
#include"bits/stdc++.h"
using namespace std;
#define MOD 1000000007

long long int ppow(long long int i, long long int j) {
	long long int res = 1LL;
	while (j) {
		if ((j & 1LL)) {
			res *= i;
			if (res >= MOD) {
				res %= MOD;
			}
		}
		j >>= 1;
		i *= i;
		if (i >= MOD) {
			i %= MOD;
		}
	}
	return res;
}
long long int gcd(long long int a, long long int b) {
	if (a > b) {
		swap(a, b);
	}
	while (a) {
		swap(a, b);
		a %= b;
	}
	return b;
}
long long int lcm(long long int a, long long int b) {
	return a / gcd(a, b)*b;
}

int main(){
	int cnt1 = 0;
	int cnt2 = 0;
	int cnt3 = 0;
	int n;
	cin >> n;
	int a, b;
	cin >> a >> b;
	for (int i = 0; i < n; i++) {
		int d;
		scanf("%d", &d);
		if (d <= a) {
			cnt1++;
			continue;
		}
		if (d <= b) {
			cnt2++;
			continue;
		}
		cnt3++;
	}
	cout << min(cnt1, min(cnt2, cnt3))<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <stack>
#include <string>
#include <ctime>
#include <stdio.h>
#include <string.h>

using namespace std;

#define re return
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int) (x).size())
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repm(i, n) for (int i = 1; i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define vi vector<int>
#define vl vector<long>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int,int>
#define vpii vector< pair<int,int> >
#define ll long long
#define ld long double 
#define str string
// freopen("firesafe.in", "r", stdin);
// freopen("firesafe.out", "w", stdout);

//map<ll,ll>mmap;
int main(){
   int n;
   cin>>n;
   int a[1001];
   int mini=10000;
   int maxi=-1;
   rep(i,n){
      cin>>a[i];
      if(a[i]<mini){
        mini=a[i];
      }
      if(a[i]>maxi){
        maxi=a[i];
      }
   }

    cout<<maxi-mini<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
	string A;
	cin >> A;
	string ans = "consonant";
	char s[5] = { 'a', 'i', 'u', 'e', 'o' };
	for (int i = 0; i <= A.length(); i++)
	{
		for (int n = 0; n < 5; n++)
		{
			if(s[n] == A[i])
			{
				ans = "vowel";

			}
		}

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

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<queue>
#define MaxValue 100000007
using namespace std;
int num[10];
int mg[10][10];
queue<int>QQ;
void bfs()
{
	QQ.push(1);
	num[1]=0;
	while(!QQ.empty())
	{
		int now_col=QQ.front();
	
		for(int i=0;i<10;i++)
		{
			if(num[i]>num[now_col]+mg[i][now_col])
			{
				num[i]=num[now_col]+mg[i][now_col];
				QQ.push(i);
			}
		}
		QQ.pop();
	}
}
int main()
{
	for(int i=0;i<10;i++)
		num[i]=MaxValue;
	int N,M;
	scanf("%d %d",&N,&M);
	for(int i=0;i<10;i++)
		for(int k=0;k<10;k++)
			scanf("%d",&mg[i][k]);
	bfs();
	long long sum=0;
	
	for(int i=0;i<N;i++)
		for(int k=0;k<M;k++)
		{
			int num1;
			scanf("%d",&num1);	
			if(num1!=-1)
				sum+=num[num1];
		 } 
	printf("%lld\n",sum);
	return 0;
 } 

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

int N, M;
int K, A;
int cnt[50];

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

    std::cin >> N >> M;

    for(int i=0;i<N;++i){
        std::cin >> K;

        for(int j=0;j<K;++j){
            std::cin >> A;

            cnt[A] += 1;
        }
    }

    int res = 0;
    for(int i=1;i<=M;++i){
        if(cnt[i] == N){
            res += 1;
        }
    }

    std::cout << res << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()

int H,W,h,w;

vector<vector<int>> ans(505,vector<int>(505,1));

vector<int> A(505,1e8);
int main(){
  A[0] = 0;
  cin >> H >> W >> h >> w;
  if(H % h == 0 && W % w == 0){
    cout << "No" << endl;
    return 0;
  }
  bool s = false;
  if(H % h != 0 && W % w == 0){
    s = true;
    swap(H,W);
    swap(h,w);
  }
  A[w] = -1e8;
  rep(i,w + 1,W){
    A[i] = A[i - w] - 1;
  }
  for(int i = 0;i < H;i++){
    for(int j = 0;j < W;j++){
      ans[i][j] = A[j + 1] - A[j];
    }
  }
  cout << "Yes" << endl;

  if(s){
    auto res = ans;
    for(int i = 0;i < H;i++){
      for(int j = 0;j < W;j++){
        res[j][i] = ans[i][j];
      }
    }
    swap(H,W);
    swap(h,w);
    ans = res;
  }
  for(int i = 0;i < H;i++){
    for(int j = 0;j < W;j++){
      cout << ans[i][j] << " \n"[j == W - 1];
    }
  }
}



Measured memory_bytes: 3976
# inputを取得
S = input()
# 前半の文字列をつくる
zen = S[0 : (len(S))//2]
# 後半の文字列をつくる
kou = S[(len(S) + 1)//2 : len(S)]
flag = False

# 回文チェッカーを作成
def isKai(arg):
  res = True

  # 前からと後ろから順番に比較する
  for i in range(len(arg) // 2):
    if arg[i] != arg[-i-1]:
      # 一致しなかったらFalseにしてチェック終了
      res = False
      break
  return(res)

# 回文かどうかをチェックしてフラグに設定
if isKai(S) and isKai(zen) and isKai(kou):
  flag = True

# フラグに応じて結果を出力
if flag == True:
  print("Yes")
else:
  print("No")


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
long long n,x;
long long ans;
void solve(long long a,long long b)
{
    if(a%b==0)
    {
        ans=ans+2*a-b;
        return;
    }
    ans+=a/b*b*2;
    solve(b,a%b);
}
int main()
{
    cin>>n>>x;
    ans=n;
    solve(max(n-x,x),min(n-x,x));
    cout<<ans;
}

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

int main() {
  int N, K;
  cin >> N >> K;

  map<int, int> m;
  rep(i,0,17) m[i] = pow(2, i);

  double ans = 0;
  rep(i,1,N) {
    int j = 0;
    while (i * m[j] < K) j++;
    ans += pow(0.5, j) / N;
  }

  printf("%.12f\n", ans);
  return 0;
}


Measured memory_bytes: 384
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

int main() {
#ifdef DEBUG
  ifstream ifs("in.txt");
  cin.rdbuf(ifs.rdbuf());
#endif
  string S;
  while (cin >> S) {
    bool res = false;
    for (int i = 0; i < S.size(); i++) {
      for (int j = i + 1; j < S.size(); j++) {
        if (S[i] != S[j]) res = true;
      }
    }
    cout << (res ? "Yes" : "No") << endl;
  }
  return 0;
}


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

typedef long long ll;

const int mod = 998244353;
const int Maxn = 3000005;

int fac[Maxn], inv[Maxn];
int n, m;
int res;

int toPower(int a, int p)
{
    int res = 1;
    while (p) {
        if (p & 1) res = ll(res) * a % mod;
        p >>= 1; a = ll(a) * a % mod;
    }
    return res;
}

int Inv(int x) { return toPower(x, mod - 2); }

int C(int n, int k)
{
    if (n < 0 || k < 0 || k > n) return 0;
    return ll(fac[n]) * inv[k] % mod * inv[n - k] % mod;
}

int main()
{
    fac[0] = inv[0] = 1;
    for (int i = 1; i < Maxn; i++) {
        fac[i] = ll(i) * fac[i - 1] % mod;
        inv[i] = Inv(fac[i]);
    }
    scanf("%d %d", &n, &m);
    for (int x = 0; x <= n && x <= m; x++) if ((3 * m - x) % 2 == 0) {
        int S = (3 * m - x) / 2;
        // take m
        res = (res + ll(n) * C(S - m + n - 2, n - 2) % mod * C(n - 1, x)) % mod;
        // not take m
        int av = m;
        int ways = (C(S + n - 1, n - 1) - ll(n) * C(S - av + n - 1, n - 1) % mod + mod) % mod;
        res = (res + ll(ways) * C(n, x)) % mod;
    }
    printf("%d\n", res);
    return 0;
}


Measured memory_bytes: 23680
s=input()
if s[0]==s[1] and s[2]==s[3] and s[0]!=s[2]:
  print("Yes")
elif s[0]==s[2] and s[1]==s[3] and s[0]!=s[1]:
  print("Yes")
elif s[0]==s[3] and s[1]==s[2] and s[0]!=s[1]:
  print("Yes")
else:
  print("No")


Measured memory_bytes: 3060
n = int(input())
box = list(map(int, input().split()))
def serch(s, l=0,r=n):
    while l < r:
        mid = (l+r)//2
        if box[mid] == s:
            return 1
        if s > box[mid]:l = mid+1
        if s < box[mid]:r = mid
    return 0
q = int(input())
for _ in range(q):
    print(serch(int(input())))


Measured memory_bytes: 17192
class Dish:

    dish_sum = 0
    dish_max = 0

    def __init__(self,value):
        self.value = value
        self.diff = (10 - value) % 10
        Dish.dish_sum += self.value + self.diff
        Dish.dish_max = self.diff if Dish.dish_max < self.diff else Dish.dish_max


dishes = [Dish(int(input())) for i in range(5)]
print(Dish.dish_sum - Dish.dish_max)


Measured memory_bytes: 2940
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
#include <deque>

using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

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

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;
typedef pair<ll, ll> PLL;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;

  REP(i, 3) {
    cout << s[i];
  }

  cout << endl;
}


Measured memory_bytes: 3652
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i = 0; i < (ll)(n); i++)
map<ll, ll> prime_factor(ll n) {
    map<ll, ll> res;
    for(ll i = 2; i * i <= n; i++) {
        while(n % i == 0) {
            ++res[i];
            n /= i;
        }
    }
    if (n != 1) res[n] = 1;
    return res;
}

int main(){
ll n;
cin >>n;
map<ll,ll> sum;
for(ll i=2;i<=n;i++){
map<ll ,ll> x=prime_factor(i);
for(ll j=2;j<=i;j++){
sum[j]+=x[j];
}
}
ll ans=1;
for(ll i=2;i<=n;i++){
if(sum[i]!=0){
ans=ans*(sum[i]+1);
ans=ans%1000000007;


}
}

cout <<ans;
return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#define Z class
#define ln cout<<'\n'
#define ll long long
#define rep(i, n) for(int i = 0; i < (n); ++i)

// int H[N]; rep(i,N) scanf("%d", &H[i]);
// int max_x = *std::max_element(x.begin(), x.end());
// int min_y = *std::min_element(y.begin(), y.end());
using namespace std;

template<class T> inline bool chmax(T& a, T b){ if(a < b) { a=b; return 1; }return 0;}
template<class T> inline bool chmin(T& a, T b){ if(a > b) { a=b; return 1; }return 0;}
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;
// spring s; cin >> s;
// cout << res << endl;
// --------write my code!!!!!----------//

// I'm trying to ~~~
int main(){
    string s; cin >> s;
    bool flag=0;
    rep(i,3){
        if(s[i-1]==s[i]&&s[i]==s[i+1]) flag=1;
    }
    if(flag) pr("Yes");
    else pr("No");
}



Measured memory_bytes: 256
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin>>s;
  if(s[6]>='5' || s[5]=='1'){
    cout<<"TBD";
  }
  else{
    cout<<"Heisei";
  }
  return(0);
}


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

long long r, d, x;

int main(){
    scanf("%lld%lld%lld", &r, &d, &x);
    for(int i = 0; i < 10; i++){
        x = r*x - d;
        printf("%lld\n", x);
    }
}

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

int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

    int
    main()
{
  int N, A, B;
  cin >> N >> A >> B;
  int total = 0;
  for (int i = 1; i <= N; ++i) {
    int sum = findSumOfDigits(i);
    if (sum >= A && sum <= B) {
      total += i;
    }
  }
  cout << total << endl;
}

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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define ALPHABET    (26)
#define INF         INT_MAX
#define MOD         (1000000007LL)

using LL  = long long;
// }}}

int main() {
    std::ios::sync_with_stdio(false);
    string s;cin >> s;
    int n = s.size();
    int l = 0;
    int r = 0;
    int count = 0;
    while(l < n && r < n){
        while(s[l] == 'T'){
            l++;
        }
        while(s[r] == 'S'){
            r++;
        }
        if(l >= n || r >= n) break;
        if(l >= r){
            r++;
        }else{
            count++;
            l++;
            r++;
        }
    }
    cout << n-2*count << endl;
    return 0;
}


Measured memory_bytes: 720
#include<bits/stdc++.h>
using namespace std;
int a,b,n;
int main()
{
    string s;
    cin>>a>>b;
    n=a+b;
    bool flag=false;
    cin>>s;
    if(s[a]!='-') flag=true;
    for(int i=0;i<=n;i++)
    {
        if(i==a) continue;
        if(!(s[i]>='0' && s[i]<='9')) flag=true;
    }
    if(!flag) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n): return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop

X=n0()

def primes(n):
    num = [True]*n
    num[0] = num[1] = False
    for i in range(2,int(n**0.5)+1):
        if num[i]:
            for j in range(i**2, n, i):
                num[j] = False
    return [i for i in range(2,n) if num[i]]

sosuu=primes((10**5)+1000)
while True:
    if X in sosuu:
        print(X)
        break
    X+=1

Measured memory_bytes: 39536