akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>

using namespace std;

typedef long long int LL;
const int Max_N(505);
const int Max_S(10000000);
const int dx[] = {+1, -1, +0, +0};
const int dy[] = {+0, +0, +1, -1};

constexpr LL gcd(LL a, LL b)
{
	return b == 0LL ? a : gcd(b, a % b);
}

constexpr LL lcm(LL a, LL b)
{
	return a / gcd(a, b) * b;
}

int N, ps, P[Max_S];
LL A[Max_N][Max_N];
bool Prime[Max_S];

int main()
{
	memset(Prime, true, sizeof(Prime)), Prime[0] = Prime[1] = false;
	for (int i = 2;i < Max_S;++i)
	{
		if (Prime[i])
			P[++ps] = i;
		for (int j = 1, x;j <= ps && (x = i * P[j]) < Max_S;++j)
		{
			Prime[x] = false;
			if (i % P[j] == 0)
				break;
		}
	}
	scanf("%d", &N);
	if (N == 2)
	{
		printf("%d %d\n", 4, 7);
		printf("%d %d\n", 23, 10);
		return 0;
	}
	for (int i = 1;i <= N;++i)
		for (int j = 1;j <= N;++j)
			if (!((i + j) & 1))
				A[i][j] = P[(i + j) >> 1] * 1LL * P[N + (i - j) / 2 + (N + 1) / 2];
	for (int i = 1;i <= N;++i)
	{
		for (int j = 1;j <= N;++j)
		{
			if ((i + j) & 1)
			{
				A[i][j] = 1LL;
				for (int k = 0, x, y;k < 4;++k)
					if (1 <= (x = i + dx[k]) && x <= N && 1 <= (y = j + dy[k]) && y <= N)
						A[i][j] = lcm(A[i][j], A[x][y]);
				++A[i][j];
			}
			printf("%lld ", A[i][j]);
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 19456
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; }
typedef long long ll;
int n,m,q;
int a[100],b[100],c[100],d[100];
int res;
void dfs(int v, int cnt, vector<int> vec) {
  vec.push_back(cnt);
  if(v == n-1) {
    int sum = 0;
    rep(i,q) {
      if((vec[b[i]] - vec[a[i]]) == c[i]) sum += d[i];
    }
    chmax(res, sum);
    // rep(i,vec.size()) cout << vec[i] << " ";
    // cout << "\n";
    return ;
  }
  for (int i = cnt; i < m; ++i) {
    dfs(v+1 , i, vec);
  }
}
int main()
{
  cin >> n >> m >> q;
  
  rep(i,q) { 
    cin >> a[i] >> b[i] >> c[i] >> d[i];
    a[i]--; b[i]--;
  }

  res = 0;
  vector<int> vec;
  dfs(0, 0, vec);
  cout << res << "\n";
  
  return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	char c=getchar();bool f=0;x=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return x;
}
template<class t> inline void write(t x){
	if(x<0) putchar('-'),write(-x);
	else{if(x>9) write(x/10);putchar('0'+x%10);}
}

int n,k,ans;

signed main(){
	read(n);read(k);
	while(n) n/=k,ans++;
	write(ans);
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(int argc, char const *argv[])
{
    char lr[] = {'R', 'L'};
    char S[101];
    cin >> S;
    for(int i = 0; S[i] != '\0' && S[i] != '\n'; i++){
        if(S[i]=='U' || S[i]=='D') continue;
        if(S[i] != lr[i%2]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M, K = il()
    # 累積和
    A = list(itertools.accumulate([0] + il()))
    B = list(itertools.accumulate(([0] + il())))

    ret = 0
    for n in range(N + 1):
        if A[n] > K:
            break

        # 二分探索
        b = bisect.bisect_right(B, K - A[n])
        ret = max(ret, n + b - 1)
    print(ret)


if __name__ == '__main__':
    main()


Measured memory_bytes: 42700
//header{{{
#include<bits/stdc++.h>
  
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define setout(n,x) setw(n+1) << setfill(x)
#define Fixed fixed << setprecision(10)
#define int int64_t
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1e9+7; 

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class A, class B> using umap = unordered_map<A,B>;
  
int gcd(int a,int b){ return b ? gcd(b,a % b) : a;}
int lcm(int a,int b){ return a / gcd(a,b) * b;}
//}}}
bool IsPrime(int n){
	if(n == 2) return true;
	if(n < 2 || n % 2 == 0) return false;
	for(int i = 3;i * i <= n;i += 2){
		if(n % i == 0) return false;
	}
	return true;
}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    int x;
    cin >> x;
    for(int i = x;;++i){
        if(IsPrime(i)) return cout << i << '\n',0;
    }
	return 0;
}


Measured memory_bytes: 256
var i:longint;
    s:string;
    a,b:boolean;
begin
    a:=false;
    b:=false;
    readln(s);
    for i:=1 to length(s) do
    begin
        if s[i]='C' then a:=true;
        if (s[i]='F')and(a) then b:=true;
    end;
    if b then write('Yes') else write('No');
end.

Measured memory_bytes: 128
/**
*    created: 12.07.2020 11:53:35
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b) {if (b < a) {a = b; return 1;} return 0;}
const long double pi = acos(-1.0);
const int MAX = 1000010;
const int INF = 1LL << 60;
const int MOD = 1000000007;
// const int MOD = 998244353;

// Template for ModInt
template <typename T> T pow(T a, long long n, T e = 1) {
    T ret = e;
    while (n) {if (n & 1) ret *= a; a *= a; n >>= 1;}
    return ret;
}
template <int mod> struct ModInt {
    int x;
    ModInt() : x(0) {}
    ModInt(long long x_) {if ((x = x_ % mod + mod) >= mod) x -= mod;}
    ModInt& operator+=(ModInt rhs) {if ((x += rhs.x) >= mod) x -= mod; return *this;}
    ModInt& operator-=(ModInt rhs) {if ((x -= rhs.x) < 0) x += mod; return *this;}
    ModInt& operator*=(ModInt rhs) {x = (unsigned long long)x * rhs.x % mod; return *this;}
    ModInt& operator/=(ModInt rhs) {x = (unsigned long long)x * rhs.inv().x % mod; return *this;}
    ModInt operator-() const {return -x < 0 ? mod - x : -x;}
    ModInt operator+(ModInt rhs) const {return ModInt(*this) += rhs;}
    ModInt operator-(ModInt rhs) const {return ModInt(*this) -= rhs;}
    ModInt operator*(ModInt rhs) const {return ModInt(*this) *= rhs;}
    ModInt operator/(ModInt rhs) const {return ModInt(*this) /= rhs;}
    bool operator==(ModInt rhs) const {return x == rhs.x;}
    bool operator!=(ModInt rhs) const {return x != rhs.x;}
    ModInt inv() const {return pow(*this, mod - 2);}
    friend ostream& operator<<(ostream& s, ModInt<mod> a) {s << a.x; return s;}
    friend istream& operator>>(istream& s, ModInt<mod>& a) {s >> a.x; return s;}
};
using mint = ModInt<MOD>;

signed main() {

    cin.tie(0);
    ios_base::sync_with_stdio(false);

    int n; cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    vector<int> pcn(60);
    rep(i,60) rep(j,n) if ((a[j] >> i) & 1) pcn[i]++;
    mint ans = 0;
    mint t = 1;
    rep(i,60) {
        mint tmp = pcn[i]*(n-pcn[i]);
        mint ad = tmp * t;
        ans += ad;
        t *= 2;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5588
#include <iostream>
#include <string>

int main() {
  std::string s, t, u;
  int a, b;
  std::cin >> s >> t >> a >> b >> u;
  if (u == s) {
    std::cout << a-1 << ' ' << b << std::endl;
  } else {
    std::cout << a << ' ' << b-1 << std::endl;
  }
  return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
#n = 3
#a = [1, 0, 0]
#n = 10
#a = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
b = [0] * n
for i in range(n // 2, n):
    b[i] = a[i]
#print(a)
#print(b)
for i in range(n // 2, 0, -1):
    s = sum(b[(i*2)-1:n:i])
    b[i - 1] = (s % 2) ^ a[i - 1]
    #print("i:{} s:{} b[{}]:{}".format(i, s, i - 1, b[i - 1]))
print(sum(b))
ans = ""
for i in range(n):
    if b[i] == 1:
        ans = ans + "{} ".format(i + 1)
print(ans.strip())


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


/// File input & output /////
#define fRead(x)        freopen("x.txt","r",stdin)
#define fWrite(x)       freopen ("x.txt","w",stdout)

#define mt              make_tuple
#define ld              long double
#define ll              long long
#define ull             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define INF             2e16
#define PI              acos(-1.0)
#define mp              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>


#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())


#define FASTIO        ios_base::sync_with_stdio(0);cin.tie(nullptr);




///..................Sort by second element in a pair in decending order............. ///
bool SortbySecDesc(const pair<long long,long long > &a, const pair<long long,long long > &b)
{
    return a.second>b.second;
}

///.........................first element of pair in descending order..........................//////
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}



///.............................................................TEMPLATE................................................./////

int main()
{
    FASTIO;
    ll a , b , c , d;

    cin >> a >> b >> c >> d;

    int f = 1;



    while(1)
    {
        if(f)
        {
            c = c-b;

            //cout << a << endl;

            if(c<=0)
            {
                cout << "Yes" << endl;
                return 0;
            }
            f = 0;
        }
        else
        {
            a = a - d;

            if(a<=0)
            {
                cout << "No" << endl;
                return 0;
            }

            f = 1;
        }
    }







    return 0;
}



Measured memory_bytes: 3648
/* maybemaybemaybeno */
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
typedef long double lld ;
#define f(i,s,n) for(int i=s;i<(int)n;i++) 
const int MAXN = 1e6+6 ;
#define pb push_back 
#define X first 
#define Y second 
#define pii pair<int,int> 
#define pll pair<ll,ll> 
#define pli pair<ll,int> 
#define pil pair<int,ll> 
#define fio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<setprecision(10) ;
#define is(x) cout<<#x<<" : "<<x<<endl ;
// #define DEBUG
bool notPrime[MAXN] ;
ll sumz[MAXN];
vector<ll> primes ;
void sieve()
{
    f(i,2,MAXN)
    {
        if(notPrime[i]) continue ;
        primes.pb(i);
        for(ll j=(ll)i*i;j<MAXN;j+=i)
        {
            notPrime[(int)j] = true ;
        }
    }
}
void init()
{
    sumz[1] = 1 ;
    sumz[2] = 3 ;
    f(i,3,MAXN)
    {
        sumz[i] = sumz[i-1]+i ;
    }
}
int main()
{
    fio ;
    /* ======================Start of code ================ */
    ll N;cin>>N ;
    ll orig = N ;
    if(N==1) return cout<<0<<"\n",0 ;
    sieve() ;
    init() ;
    ll ans = 0 ;
    f(i,0,primes.size())
    {
        int k=0;
        ll p = primes[i] ;
        if(p>N ) break ;
        if(N%p) continue ;
        while((N%p)==0) N/=p,k++ ;
        #ifdef DEBUG 
        if(k) {is(p);is(k) ;}
        #endif 
        ans+=(ll)(upper_bound(sumz,sumz+MAXN,k)-sumz)-1 ;
    }
    cout<<(ans+(N!=1))<<"\n" ;
    /* ======================End of code ================== */
}

Measured memory_bytes: 12564
#全探索＝＝TLE（たぶん）
N = gets.to_i
num = gets.strip.split.map(&:to_i)
ary = Array.new(N,0)
ary[0] = num[0]
for i in 1..N-1
  if ary[i-1] > num[i]
    ary[i] = num[i]
  else
    ary[i] = ary[i-1]
  end
end
s = 0
for i in 0..N-1
  if ary[i] == num[i]
    s += 1
  end
end
puts s

Measured memory_bytes: 30192
#[allow(unused_macros)]
macro_rules! input {
    ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } };
    ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } };
}
#[allow(unused_macros)]
macro_rules! input_inner {
    ( $ next : expr ) => { };
    ( $ next : expr , ) => { };
    ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } };
}
#[allow(unused_macros)]
macro_rules! read_value {
    ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) };
    ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) };
    ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) };
    ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 };
    ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) };
}

fn main() {
    input! {
        n: usize,
        plans: [(i64, i64, i64); n]
    }

    let mut yes = true;
    for i in 0..n {
        let (t,x,y) = plans[i];
        let (to,xo,yo) = if i >= 1 {plans[i-1]} else {(0,0,0)};
        let d = (x - xo).abs() + (y - yo).abs();
        let td = t - to;
        if !(td >= d && td % 2 == d % 2) {
            yes = false;
            break;
        }
    }
    println!("{}", if yes {"Yes"} else {"No"});
}

Measured memory_bytes: 8444
#include<bits/stdc++.h>
using namespace std;
#define READ() freopen("in.txt","r",stdin)
#define WRITE() freopen("out.txt","w",stdout)
#define  pb(x)  push_back(x)
#define mem(arr,val) memset(arr,val,sizeof(arr));
typedef long long ll;
const int mx=30005;
vector<int>G[mx],cost[mx];
struct data{
    bool ev;
    int val;
};

bool cmp(data a,data b)
{
    if(a.val<b.val)
    {
        return true;
    }
    if(a.val==b.val)
    {
        return a.ev;

    }
    return false;
}
int vis[100][26];

int main()
{
//    READ();
    int k;
    int a[3];
    cin>>a[0]>>a[1]>>a[2]>>k;
    sort(a,a+3);
    int sum=a[0]+a[1];
    for(int i=0;i<k;i++)
    {
        a[2]*=2;
    }
    sum+=a[2];
    cout<<sum<<endl;





    return 0;
}


Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	vector<int>v;
	v.resize(n);
	for(int i=0;i<n;i++)
	{
		cin>>v[i];
	}
	//sort(v.begin(),v.end());
	int cnt=1;
	for(int i=0;i<n;i++)
	{
		if(v[i]!=cnt)
		{
			v[i]=-1;
		}
		else if(v[i]==cnt)
		{
			cnt++;
		}
	}
	int ans=0;
	for(int i=0;i<n;i++)
	{
		if(v[i]==-1)
			ans++;
	}
	if(ans<n)
	{
		cout<<ans<<"\n";
	}
	else
	{
		cout<<"-1\n";
	}
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 10000000000
using namespace std;
using ll = long long;
int main()
{
    int x;
    cin >> x;
    int ans = 1;
    for (int i = 2; i <= x;i++){
        for (int j = 2; j*j <= i;j++){
            int tmp = i;
            while(!(tmp%j)){
                tmp /= j;
            }
            if(tmp==1){
                ans = i;
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }     //最小公倍数
using Graph = vector<vector<ll>>;
ll inf=300000000000000000;
const double PI = 3.14159265358979323846;
int main(){
  int n;
  cin >> n;
  vector<int> k(n);
  vector<int> o(n);
  rep(i,n){
    int a,b;
    cin >> a >> b;
    k[i]=a;
    o[i]=-b;
  }
  sort(k.begin(),k.end());
  sort(o.begin(),o.end());
  if(n%2==0){
    int a=k[n/2-1],b=k[n/2];
    int c=-o[n/2-1],d=-o[n/2];
    cout << d+c-a-b+1 << endl;
  }
  else{
    cout << -o[n/2]-k[n/2]+1 << endl;
  }
}  


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

#define ll long long
#define ull unsigned long long
#define db long double
#define pb push_back
#define ppb pop_back
#define F first
#define S second
#define mp make_pair
#define all(x) (x).begin(), (x).end()

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int N = 203;
int n;

struct pt {
	ll x = 0, y = 0;
	pt operator + (const pt & p) const {
		pt res;
		res.x = x + p.x;
		res.y = y + p.y;
		return res;
	}
	pt operator - (const pt & p) const {
		pt res;
		res.x = x - p.x;
		res.y = y - p.y;
		return res;
	}
	ll operator * (const pt & p) const {
		return x * p.y - y * p.x;
	}
	bool half() {
		pt p = * this;
		return p.y > 0 || (p.y == 0 && p.x < 0); 
	}
	bool operator < (pt b) const {
		pt a = * this;
		if (a.half() == b.half()) {
			return a * b > 0;
		}
		return a.half() < b.half();
	}
};

pt p[N];

int main() {
	ios_base::sync_with_stdio(false), cin.tie(NULL);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	
	cin >> n;
	vector <pii> vec;
	pii t;
	for (int i = 1; i <= n; i++) {
		cin >> t.F >> t.S;
		if (t.F != 0 || t.S != 0) {
			vec.pb(t);
		}
	}
	if (vec.empty()) {
		cout << 0;
		return 0;
	}
	n = vec.size();
	for (int i = 1; i <= n; i++) {
		p[i].x = vec[i - 1].F;
		p[i].y = vec[i - 1].S;
	}
	sort(p + 1, p + n + 1);
	for (int i = 1; i <= n; i++) {
		p[n + i] = p[i];
	}
	n *= 2;
	db ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = i; j <= n; j++) {
			if (j - i + 1 > n / 2) {
				continue;
			}
			pt tmp;
			for (int k = i; k <= j; k++) {
				tmp = tmp + p[k];
			}
			ans = max(ans, (db)tmp.x * tmp.x + (db)tmp.y * tmp.y);
		}
	}
	cout << setprecision(50) << sqrtl(ans);
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>

using namespace std;

int main() {
  int n;
  int a, b, c;
  int minv;
  cin >> n;
  cin >> a >> b;
  minv = min( a, b );
  if( n == 3 ) {
    cin >> c;
    minv = min( minv, c );
  }

  for( int i = 1; i <= minv; i++ ) {
    if( !( a % i ) && !( b % i ) ) {
      if( ( n == 3 && !( c % i ) ) || n == 2 ) {
        cout << i << endl;
      }
    }
  }

  return EXIT_SUCCESS;
}

Measured memory_bytes: 1160
<?php
/*
    Problem URL : http://abc060.contest.atcoder.jp/tasks/abc060_d

    Score  :
    Result :
    Time   : ms
    Memory : KB
 */

ini_set('memory_limit', '256M');

// define('DEBUG', true);
define('DEBUG', false);

list($N, $W) = explode(" ", trim(fgets(STDIN)));

// $w = array_fill(0, $N, 0);
// $v = array_fill(0, $W, 0);

for ($i = 0; $i < $N; $i++) {
    list($w[$i], $v[$i]) = explode(" ", trim(fgets(STDIN)));
}
if (DEBUG) echo implode(" ", $w) . PHP_EOL;

$cnt1 = floor($W / $w[0]);
$cnt2 = floor($W / ($w[0] + 3));
if (DEBUG) echo "\$cnt: {$cnt1} {$cnt2}\n";

if ($cnt1 == $cnt2) {
    for ($i = 0; $i < $N; $i++) {
        $w[$i] = 1;
    }
    $W = $cnt1;
}
if ($cnt1 == $cnt2 + 1) {
    $avoid = $w[0];

    for ($i = 0; $i < $N; $i++) {
        $w[$i] = $w[$i] - $avoid + 300;
    }
    $W -= ($avoid - 300) * $cnt1;
}

if (DEBUG) echo implode(" ", $w) . PHP_EOL;
if (DEBUG) echo "\$W = {$W}\n";

$tmp1 = array_fill(0, $N + 1, 0);
$tmp2 = array_fill(0, $W + 1, 0);

$dp = array($tmp1, $tmp2);

for ($j = 0; $j <= $W; $j++) {
    $dp[$N][$j] = 0;
}

for ($i = $N - 1; $i >= 0; $i--) {
    for ($j = 0; $j <= $W; $j++) {
        // printf("%d < %d\n", $j, $w[$i]);
        if ($j < $w[$i]) {
            $dp[$i][$j] = $dp[$i + 1][$j];
        } else {
            $dp[$i][$j] = max($dp[$i + 1][$j], $dp[$i + 1][$j - $w[$i]] + $v[$i]);
        }
        // printf("%d %d %d\n", $i, $j, $dp[$i][$j]);
    }
}

echo $dp[0][$W]."\n";

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

#define EPS
#define INF
#define f first
#define s second
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define debugv(v) printf("%s: %d\n", #v, v);
#define debugarr(arr, ini, fim) printf("%s: ", #arr); for(int i = ini; i <= fim; i++) printf("%d%c", arr[i], i == fim ? '\n' : ' ');
#define debugarr2(arr, ini, fim) printf("%s: ", #arr); for(int i = ini; i <= fim; i++) printf("%lld%c", arr[i], i == fim ? '\n' : ' ');
typedef long long ll;
typedef pair<int, int> P;


const ll MAXN = 200010;
const ll MOD = 1000000007;

vector <ll> arr;
ll dp[MAXN];
ll prox[MAXN];
ll ultimo[MAXN];
int n;

ll soma(ll a, ll b){
	return ((a % MOD) + (b % MOD)) % MOD;
}

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

ll solve(int idx){
	if (idx >= n) return 1;
	if (dp[idx] != -1) return dp[idx];

	dp[idx] = (prox[idx] != -1) ? solve(prox[idx]) : 0;
	return dp[idx] = soma(dp[idx], solve(idx+1));
}

int main() {
	scanf("%d", &n);
	memset(dp, -1, sizeof dp);
	memset(ultimo, -1, sizeof ultimo);
	ll num, ant = -1;
	for (ll i=0; i<n; i++){
		scanf("%lld", &num);
		if (num != ant) arr.emplace_back(num);
		ant = num;
	}
	n = arr.size();

	for (int i=n; i>=0; i--){
		prox[i] = ultimo[arr[i]];
		ultimo[arr[i]] = i;
	}

	printf("%lld\n", solve(0));

	return 0;
}

Measured memory_bytes: 12912
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int A, B, C, X; cin >> A >> B >> C >> X;
  int ans = 0;
  REP(i, A+1) REP(j, B+1) REP(k, C+1){
    if(i*500+j*100+k*50 == X) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
//use itertools::Itertools;
use std::cmp;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        a: i64,
        b: i64,
        c: i64,
        k: i64
    }

    if a > k {
        println!("{}", k);
    } else if a + b >= k {
        println!("{}", a);
    } else {
        let c_num = cmp::min(k - (a + b), c);
        println!("{}", a - c_num);
    }
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet


Measured memory_bytes: 2232
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BDigitSums solver = new BDigitSums();
        solver.solve(1, in, out);
        out.close();
    }

    static class BDigitSums {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int count = 0;
            for (char c : Integer.toString(n).toCharArray()) {
                count += c - 48;
            }
            out.println(n % count == 0 ? "Yes" : "No");
        }

    }
}



Measured memory_bytes: 21332
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <queue>
#include <string>
#include <complex>

#define REP(i,n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = (s); i < (n); i++)
#define ALLOF(c) c.begin(), c.end()
#define RANGEOF(c,i,n) c.begin() + (i), c.begin() + (i) + (n)
#define EPS 1e-9
#define INF 1000000000
using namespace std;

template <class T> T read() { T t; cin >> t; return t; }
template <class T> vector<T> read(int n) { vector<T> v; REP(i,n) { v.push_back(read<T>()); } return v; }
template <class T> vector<vector<T>> read(int n, int m)
{
	vector<vector<T>> v;
	REP(i,n) { v.push_back(read<T>(m)); }
	return v;
}

template <class T> void write(const T &t) { cout << t << endl; }
template <class T> void write(const T &t, const T &t2) { cout << t << ' ' << t2 << endl; }
template <class T> void write(const vector<T> &v)
{
	ostringstream ss; 
	for (auto x : v) ss << x << ' ';
	auto s = ss.str();
	cout << s.substr(0, s.length() - 1) << endl;
}

struct _Reader { template <class T> _Reader operator ,(T &rhs) { cin >> rhs; return *this; } };
#define READ(t,...) t __VA_ARGS__; _Reader(), __VA_ARGS__

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

/// template end ///



void solve()
{
	while (true)
	{
		READ(int, H, W);
		if (!(W|H)) { break; }
		auto field = read<char>(W, H);
		for (auto &f : field) { f.insert(f.begin(), '0'); f.push_back('0'); }
		field.insert(field.begin(), vector<char>(H+2, '0'));
		field.push_back(vector<char>(H+2, '0'));
		W += 2; H += 2;

		int count = 0;
		REP(sx,W) REP(sy,H) if (field[sx][sy] == '1')
		{
			typedef complex<int> P;
			queue<P> q;
			q.push(P(sx, sy));
			while (!q.empty())
			{
				P cur = q.front(); q.pop();
				if (field[cur.real()][cur.imag()] == '0') { continue; }
				field[cur.real()][cur.imag()] = '0';
				P d[] = { P(-1,-1), P(0,-1), P(1,-1), P(-1, 0), P(1, 0), P(-1,1), P(0,1), P(1,1) };
				REP(i, 8)
				{
					P next = cur + d[i];
					if (field[next.real()][next.imag()] == '1') q.push(next);
				}
			}
			count++;
		}
		write(count);
	}
}

Measured memory_bytes: 1232
n = int(input())
s_taro,s_hanako = 0,0

for trial in range(n):
  taro,hanako = list(map(str,input().split()))
  if taro > hanako:
    s_taro += 3
  elif taro < hanako:
    s_hanako += 3
  else:
    s_taro += 1
    s_hanako +=1
print(s_taro,s_hanako)


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

int main(void){
  int N; cin >> N;
  int ans;
  vector<int> S(N);
  for(int i=0; i < N; i++){
    cin >> S[i];
  }
  for(int t=1; t <= N/2; t++){
    if(N % t != 0) continue;
    bool flg = true;
    for(int i=N/t-1; i >= 1; i--){
      for(int j=0; j < t; j++){
        if(S[i*t+j] == S[j]){
        }else{
          flg = false;
        }
      }
      if(flg == false) break;
    }
    if(flg == true){
      ans = N/t;
      break;
    }
  }
  if(ans == 0) cout << 1 << endl;
  else cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1796
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#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-7
#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 c[10]={};
	rep(i,4){
		int n;
		scan(n);
		c[n]++;
	}
	if(c[1]*c[9]*c[7]*c[4]>0) prin("YES");
	else prin("NO");
	
	return 0;
}


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

#define  pf                  printf
#define  sc                  scanf
#define  PI                  2*acos(0.0)
#define  fast                ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0)
#define  mem(a,b)            memset(a, b, sizeof(a) )
#define  gcd(a,b)            __gcd(a,b)
#define  lcm(a,b)            (a*(b/gcd(a,b)))
#define  MAX                 123456789
#define  mod                 1000000007
#define  all(v)              (v).begin(),(v).end()
#define  vSort(v)            sort(all(v))
#define  maxSort(v)          sort(all(v),greater<int>())
#define  Unique(v)           v.erase(unique(all(v)),v.end())
#define  sqr(x)              ((x)*(x))
#define  qube(x)             ((x)*(x)*(x))
#define  deci(n)             cout<<fixed<<setprecision(n)
#define  sci(n)              sc("%d",&(n))
#define  scii(x,y)           sc("%d %d",&(x),&(y))
#define  scl(x)              sc("%lld",&(x))
#define  scll(x,y)           sc("%lld %lld",&(x),&(y))
#define  vi                  vector<int>
#define  hi                  pf(" HI \n")
#define  pp                  pair<int,int>
#define  pb(x)               push_back(x)
#define  mp(x,y)             make_pair(x,y)
#define  F                   first
#define  S                   second
#define  check(n,pos)        (n & (1<<(pos)))
#define  biton(n,pos)        (n  (1<<(pos)))
#define  bitoff(n,pos)       (n & ~(1<<(pos)))
typedef  long long int       lli;
typedef  unsigned long long int ulli;
int dx4[] = { 0 , 0 , -1 , 1 } ;
int dy4[] = { -1 , 1 , 0 , 0 } ;
bool valid( int r , int c , int x , int y ){
    if( x >= 1 && x <= r && y >= 1 && y <= c ) return 1 ; return 0 ;}

using namespace std;
lli b[1000000];
int main ()
{
    lli n;
    cin >> n;
    lli a[n+4];
    for(int i=0;i<=n+2;i++)
        b[i]=MAX;
    for(int i=1;i<=n;i++)
        cin >> a[i];
    b[1]=0;
    b[0]=0;
    a[0]=a[1];
    for(int i=2;i<=n;i++)
    {
       lli p= b[i-1]+abs(a[i-1]-a[i]);
        lli q= b[i-2]+abs(a[i-2]-a[i]);
        b[i]=min(p,q);
    }
    cout << b[n]<<endl;

    return 0;
}



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

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

template<class T> using v = std::vector<T>;
template<class T> using vv = v<v<T>>;

const int mod = 1000000007;
//const int mod = 998244353;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; }}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; }}

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
    vector<mint> fact, ifact;
    combination(int n):fact(n+1),ifact(n+1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};

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

    int ans = 0;
    int l = 0, r = s.size()-1;
    while(l < r) {
        if (s[l] != s[r]) ans++;
        ++l; --r;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
L = []
for _ in range(N):
    L.append(int(input()))
def lcm(x, y):
    if x > y:
        x,y = y,x
    if x == 0:
        return y
    r = y % x
    return lcm(r,x)
def gcd(x,y):   
    return   x*y // lcm(x,y)

ans = L[0]
for x in L:
    ans = gcd(ans,x)
print(ans)

Measured memory_bytes: 38256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(); // 小さい方の整数
		int b = sc.nextInt(); // 大きい方の整数
		int k = sc.nextInt(); // 端からの範囲

		if ((b - a + 1) / k < 2) { // 全部中身を表示すれば良い
			while (a <= b) {
				System.out.println(a);
				a++;
			}
		} else { // 両端からK個表示させる
			for (int i = a; i < a + k; i++) {
				System.out.println(i);
			}
			for (int j = b - k + 1; j <= b; j++) {
				System.out.println(j);
			}

		}

	}
}


Measured memory_bytes: 22996
# coding: utf-8
# 47

n = int(input())
I = list(map(int,input().split()))

I.sort()

if (I[n-1]-I[0])%2==0:
    print((I[n-1]-I[0])//2)
else:
    print((I[n-1]-I[0])//2+1)


Measured memory_bytes: 5620
import java.util.*;
 
public class Main {
  public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		Integer[] A = new Integer [N];
		int count;
		String ans;
		int sumA = 0;
		for (int i = 0; i < N; i++) {
			int a = sc.nextInt();
			A[i] = a;
			sumA += a;
		}
		Arrays.sort(A,Collections.reverseOrder());
		if (A[M-1] >= ((double)(double)sumA/(4*(double)M))) {
      ans = "Yes";
		} else {
			ans = "No";
		}
		System.out.println(ans);
  }
}

Measured memory_bytes: 35932
#include <cstdio>

using namespace std;

int hit = 0, blow = 0,a[4], b[4];

int main()
{
    while (scanf("%d %d %d %d\n%d %d %d %d\n", &a[0], &a[1], &a[2], &a[3], &b[0], &b[1], &b[2], &b[3] ) != EOF)
    {
        hit = 0, blow = 0;
        for( int i = 0; i < 4; i++ )
        {
            if( a[i] == b[i] )
            {
                hit++;
            }
            for( int j = 0; j < 4; j++ )
            {
                if( i != j && a[i] == b[j] )
                {
                    blow++;
                }
            }
        }
        
        printf( "%d %d\n", hit, blow );

    }
    return 0;
}


Measured memory_bytes: 2568
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(int i=1,i##_len=(n); i<=i##_len; ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define srep(i,s,t) for(int i=(s);i<(t);++i)
#define rng(obj) (obj).begin(), (obj).end()
#define maxs(x,y) (x=max((x),(y)))
#define mins(x,y) (x=min((x),(y)))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x=max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T>>
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vp = vector<P>;
template <class T> inline istream& operator>>(istream&i,v(T)&v)
{ rep(j,sz(v))i>>v[j];return i;}
template <class T> string join(const v(T)&v)
{ stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template <class T> inline ostream& operator<<(ostream&o,const v(T)&v)
{ if(sz(v))o<<join(v); return o;}
template <class T1,class T2> inline istream& operator>>(istream&i ,pair<T1,T2>&v)
{ return i>>v.fi>>v.se;}
template <class T1,class T2> inline ostream& operator<<(ostream&o ,pair<T1,T2>&v)
{ return o<<v.fi<<","<<v.se;}
template <class T> inline ll suma(const v(T)& a) 
{ ll res(0); for(auto&& x:a) res += x; return res;}
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const double eps = 1e-10;
#define dame {puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;
#define fileio ifstream fio; if(argc>=2){fio.open(argv[1]); std::cin.rdbuf(fio.rdbuf());}
#define fastio ios_base::sync_with_stdio(false);
#define MOD 1000000007
//----------------------------------------------------------------
template <class T>
map< T, int > prime_factor(T n) {
    map< T, int > ret;
    for(T i = 2; i * i <= n; i++) {
        while(n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if(n != 1) ret[n] = 1;
    return ret;
}

void Main(){
  int n;
  cin>>n;
  if(n==1){cout<<1<<endl; return;}
  map<int,int> m;
  srep(in,2,n+1){
    int nn = in;
    for(int i = 2; i * i <= nn; i++) {
        while(nn % i == 0) {
            m[i]++;
            nn /= i;
        }
    }
    if(nn != 1) m[nn]++;
  }
  ll ans=1;
  for(auto i:m){
    ans *= i.se+1;
    if(ans>MOD) ans%=MOD;
  }
  cout<<ans<<endl;
} int main(int argc,char* argv[]){ 
    fastio; fileio; Main();}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x))%modulo)
#define Inf 100000000000000000



int main(){
	int N;
	cin>>N;
	long long K;
	cin>>K;
	long long sum = 0;
	vector<long long> A(N);
	for(int i=0;i<N;i++){
		cin>>A[i];
		sum+=A[i];
	}
	
	vector<long long> yaku(0);
	
	for(long long i=1;i*i<=sum;i++){
		if(sum%i==0){
			yaku.push_back(i);
			if(i*i!=sum)yaku.push_back(sum/i);
		}
	}
	
	sort(yaku.begin(),yaku.end(),greater<long long>());
	
	
	for(int i=0;i<yaku.size();i++){
		vector<pair<long long,long long>> B(N);
		long long mi = 0;
		long long pl = 0;
		for(int j=0;j<A.size();j++){
			long long x = (A[j]/yaku[i])*yaku[i];
			long long y = x+yaku[i];
			if(x==A[j])y=x;
			
			B[j].first = -abs(x-A[j]);
			B[j].second = abs(y-A[j]);
			
			mi += B[j].first;
		}
		
		sort(B.begin(),B.end(),greater<pair<long long,long long>>());
		
		
		long long cnt = Inf;
		for(int j=N-1;j>=0;j--){
			if(mi==-pl)cnt = min(cnt,pl);
			mi-=B[j].first;
			pl+=B[j].second;
		}
		
		if(cnt<=K){
			cout<<yaku[i]<<endl;
			return 0;
		}
	}
			
	
	
	return 0;
}




Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>

using ll = long long int;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

ll a[100100],p[100100];

int main(void){
	int n,i;
	ll ans = 1ll;
	std::cin >> n;
	p[0] = 1ll;
	for(i=0; i<=n; ++i){
		std::cin >> a[i];
	}
	for(i=0; i<n; ++i){
		// std::cout << i << " " << p[i] << std::endl;
		if(p[i]<a[i]){
			std::cout << -1 << std::endl;
			return 0;
		}
		p[i] -= a[i];
		p[i+1] = p[i]*2;
		p[i+1] = std::min(p[i+1],INFLL);
	}
	if(p[n]<a[n]){
		std::cout << -1 << std::endl;
		return 0;
	}
	for(i=n; i>0; --i){
		ans += a[i];
		a[i-1] += std::min(a[i],p[i-1]);
	}
	std::cout << ans << std::endl;
	return 0;
}


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

int main(){
    
    int age;
    cin >> age;
    if(age == 1){
        printf("Hello World\n");
    }else{
        int a;
        int b;
        cin>>a;
        cin>>b;
        printf("%d\n", a+b);
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int main(void){
    double a,b,C;
    double PI,rad,S,L,h;
    scanf("%lf %lf %lf",&a,&b,&C);
    PI=acos(-1);
    rad= C/180*PI;
    S=a*b*sin(rad)/2;
    L=sqrt(a*a+b*b-2*a*b*cos(rad))+a+b;
    h=b*sin(rad);
    printf("%lf\n%lf\n%lf\n",S,L,h);
    return 0;
}


Measured memory_bytes: 2040
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));

            return;
        }

        public void Solve(ConsoleInput cin)
        {
            var N = cin.ReadInt;
            var a = cin.ReadIntArray(N);

            var button = 0;
            for (int i = 0; i < N; i++)
            {
                button = a[button] - 1;
                if(button == 1)
                {
                    WriteLine(i + 1);
                    return;
                }
            }

            WriteLine("-1");

        }
    }

    public static class Extensions
    {
        public static string Reverse(this string sourse)
        {
            char[] chrAry = sourse.ToCharArray();
            Array.Reverse(chrAry);
            return new string(chrAry);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}

Measured memory_bytes: 17460
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] ar=new int[n];
        int sum=0;
        for(int i=0;i<n;i++){
            ar[i]=sc.nextInt()-1;
            sum+=ar[i];
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 27852
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <assert.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <fstream>
#include <bitset>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>

using namespace std;

const int MAXN = 2005;
const int MOD = 998244353;

int n,cnt[3];
int MAXr[MAXN << 1];
int MAXb[MAXN << 1];
int f[MAXN << 1][MAXN << 1];

char s[MAXN];

int main()
{
//	freopen("ball.in","r",stdin);
//	freopen("ball.out","w",stdout);
	scanf("%s",s + 1);
	n = strlen(s + 1);
	for (int i = 1;i <= n;i++)
	{
		cnt[s[i] - '0']++;
		for (int j = i;j <= 2 * i;j++)
		{
			MAXr[j] = max(MAXr[j],min(j,cnt[1] + cnt[0] * 2));
			MAXb[j] = max(MAXb[j],min(j,cnt[1] + cnt[2] * 2));
		}
	}
	f[0][0] = 1;
	for (int i = 1;i <= 2 * n;i++)
		for (int j = i - MAXb[i];j <= MAXr[i];j++)
		{
			f[i][j] = f[i - 1][j];
			if (j > 0)
				(f[i][j] += f[i - 1][j - 1]) %= MOD;
		}
	printf("%d\n",f[n * 2][MAXr[n * 2]]);
	return 0;
}

Measured memory_bytes: 60544
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MAX_INF 0x7f
#define MAX_INF_VAL 0x7f7f7f7f
#define pi 3.141592653589
#define eps 1e-10
//#define p 2173412051LL
#define sz 2

using namespace std;

ll a[ 1001 ], b[ 1001 ];
ll f[ 20001 ];

int main() {
	int m, n, tot = 20000;
	ll ans = MAX_INF_VAL;
	memset( f, MAX_INF, sizeof( f ) );
	f[ 0 ] = 0;
	scanf( "%d%d", &m, &n );
	for( int i = 1; i <= n; ++i ) {
		scanf( "%lld%lld", &a[ i ], &b[ i ] );
		for( int j = a[ i ]; j <= tot; ++j )
			f[ j ] = min( f[ j ], f[ j - a[ i ] ] + b[ i ] );
	}
	for( int i = m; i <= tot; ++i )
		ans = min( f[ i ], ans );
	printf( "%lld", ans );
	return 0;
}

Measured memory_bytes: 384
import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n,x,m=map(int,input().split())
s=[x]
g=set()
cnt=0
l=-1
g.add(x)
b=x
for i in range(1,n):
    nt=pow(b,2,m)
    b=nt
    if nt not in g:
        s.append(nt)
        g.add(nt)
    else:
        cnt=i
        l=nt
        break
if l==0:
    #s=list(s)
    ans=sum(s)
elif l==1:
    #s=list(s)
    ans=n-cnt+sum(s)
else:
    if l!=-1:
      idx=s.index(l)
      c=len(s)-idx
      r=(n-cnt)%c
      ans=((n-cnt)//c)*sum(s[idx:])+sum(s[idx:idx+r])+sum(s)
    else:
      ans=sum(s)
print(ans)

Measured memory_bytes: 14564