akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

#pragma GCC optimize("O3")
static const auto __ = [] {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  return nullptr;
}();

int solve(int A, int B, int T) {
  return B * (T / A);
}

int main(int argc, char* argv[]) {
  int A, B, T;
  cin >> A >> B >> T;
  cout << solve(A, B, T) << '\n';
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long int
#define mod(x) ((x % MOD) + MOD) % MOD
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RFORE(i,a,b) for(int i=(b);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(c) (int)((c).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define LB(c,x) (int)(lower_bound(ALL(c),x)-(c).begin())
#define UB(c,x) (int)(upper_bound(ALL(c),x)-(c).begin())
#define COUNT(c,x) (UB(c,x)-LB(c,x))
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define EXIST(s,e) (bool)((s).find(e)!=(s).end())
#define PB push_back
#define MP make_pair
#define DEL(v) decltype(v)().swap(v)
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
using namespace std;
template<typename T1, typename T2> using P = pair<T1,T2>;
template<typename T> using V = vector<T>;
struct edge { int from, to; int cost; };
bool operator< (const edge &edge1, const edge &edge2) { return edge1.cost < edge2.cost; };
const int INF = 1e18;
const int MOD = 1e9+7;

template<typename T> ostream& operator << (ostream& s, const V<T>& v) {
   s << "[";
   for (int i = 0; i < v.size(); i++) { s << v[i]; if (i < v.size() - 1) s << " "; }
   s << "]";
   return s;
}
template<typename T1, typename T2> ostream& operator << (ostream& s, const P<T1,T2>& p) {
   s << "(" << p.first << "," << p.second << ")";
   return s;
}

template<typename T> class BIT
{
   private:
      vector<T> bit;
      int len;
   public:
      BIT(int n) {
         len = n+1;
         bit.resize(len);
      }
      void add(int i, T x) {
         i += 1;
         while (i < len) {
            bit[i] += x;
            i += i & -i;
         }
      }
      int sum(int i) {
         i += 1;
         T s = 0;
         while (i > 0) {
            s += bit[i];
            i -= i & -i;
         }
         return s;
      }
};

void compose(const vector<int>& v, vector<int>& u) {
   int N = v.size();
   vector<pair<int,int>> tmp(N);
   for (int i = 0; i < N; i++) tmp[i] = make_pair(v[i],i);
   sort(tmp.begin(),tmp.end());
   for (int i = 0; i < N-1; i++) {
      u[tmp[i+1].second] = u[tmp[i].second] + (tmp[i+1].first == tmp[i].first ? 0 : 1);
   }
}

int solve(const vector<int>& v) {
   int N = v.size();
   BIT<int> bit(N);
   int res = 0;
   for (int i = 0; i < N; i++) {
      res += bit.sum(v[i]);
      bit.add(v[i], 1);
   }
   return res;
}

signed main()
{
   int N, K; cin >> N >> K;
   V<int> a(N);
   REP(i, N) {
      cin >> a[i];
   }

   REP(i, N) {
      a[i] -= K;
   }

   V<int> s(N+1);
   REP(i, N) {
      s[i+1] = s[i] + a[i];
   }

   V<int> t(N+1);
   compose(s, t);
   int ans = solve(t);
   cout << ans << endl;

   return 0;
}


Measured memory_bytes: 8064
#include <iostream>

void solve(int64_t t1, int64_t t2, int64_t a1, int64_t a2, int64_t b1, int64_t b2) {
  if (t1 * a1 + t2 * a2 == t1 * b1 + t2 * b2) {
    std::cout << "infinity" << std::endl;
    return;
  }
  int64_t ans = 0;
  int64_t X = t1 * a1 + t2 * a2 - t1 * b1 - t2 * b2;
  if (X < 0) {
    X = -X;
    std::swap(a1, b1);
    std::swap(a2, b2);
  }
  if (b1 - a1 > 0) {
    ans += t1 * (b1 - a1) / X;
  }
  int64_t Y = t1 * (b1 - a1 - b2 + a2);
  int64_t l, r;
  if (b2 - a2 > 0) {
    l = t1 * (b2 - a2) + Y;
    r = (t1 + t2) * (b2 - a2) + Y;
  } else {
    l = -(t1 + t2) * (a2 - b2) + Y;
    r = -t1 * (a2 - b2) + Y;
  }
  if (r > 0) {
    int64_t nr = (r + X - 1) / X;
    int64_t nl = l < 0 ? -1 : l / X;
    if (nr - nl - 1 > 0) ans += nr - nl - 1;
  }
  std::cout << ans << std::endl;
  return;
}

int main() {
  int64_t t1, t2, a1, a2, b1, b2;
  std::cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
  solve(t1, t2, a1, a2, b1, b2);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f(a, n) for (int a=0; a<n; a++)
#define F(a, n) for (int a=1; a<=n; a++)
using namespace std;
bool A[26];
string s, s2;
int main(){
	cin.tie(NULL);
	ios::sync_with_stdio(0);
	cin>>s;
	if (s.length() < 26){
		f(i, s.length()) A[s[i] - 'a'] = 1;
		f(i, 26) if (!A[i]) {
			s += char('a' + i);
			break;
		}
		cout<<s<<endl;
	}
	else if (s == "zyxwvutsrqponmlkjihgfedcba") cout<<-1<<endl;
	else{
		char B[26];
		f(i, 26) B[i] = s[i];
		next_permutation (B, B+26);
		f(i, 26) s2 += B[i];
		while (s2>s) s2 = s2.substr (0, s2.length()-1);
		s2 += B[s2.length()];
		cout<<s2<<endl;
	}
}

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

int main() {
        int i, j;
        while (true) {
                string a;
                int l;
                cin >> a >> l;
                if (a == "0" && l == 0) break;
                int index = 1;
                map<int, int> s;
                s[stoi(a)] = 0;
                string A(l, '0');
                for (i = 0; i < a.size(); i ++) {
                        A[i] = a[i];
                }
                int indexi, indexj, ans;
                while (true) {
                        sort(A.begin(), A.end());
                        int x = stoi(A);
                        reverse(A.begin(), A.end());
                        int y = stoi(A);
                        int diff = y - x;
                        if (s.count(diff)) {
                                indexi = index;
                                indexj = s[diff];
                                ans = diff;
                                break;
                        }
                        s[diff] = index;
                        A = to_string(diff);
                        A.resize(l, '0');
                        index ++;
                }
                cout << indexj << ' ' << ans << ' ' << indexi - indexj << endl;
        }
        return 0;
}

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

int main() {
  char c;
  cin >> c;
  if ('A' <= c && c <= 'Z') {
    c = 'A';
  } else if ('a' <= c && c <= 'z') {
    c = 'a';
  }

  char cc[] = {"\n"};
  cc[0] = c;
  string s(cc);
  cout << s << endl;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
using ll= long long ;
using P = pair<ll,ll>;
#define rep(i,n) for (ll i = 0; i<(ll)(n); i++)
#define mod 1000000007
#define pi 3.141592653589793
typedef vector<ll> vcl;

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a, ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t =rep_jijo(n,x/2);
        return t*t%mod;
  }
  return n*rep_jijo(n,x-1)%mod;
}
ll c2(ll n){
    return n*(n-1)/2;
}

int main(){
ll n;
ll ans = 0;
cin>>n;
vcl a(n);
rep(i,n)cin>>a[i];
for(ll i=0;i<n;i++){
    for(ll j=i+1;j<n;j++){
        for(ll k=j+1;k<n;k++){
            if(a[i]+a[j]>a[k] && a[j]+a[k]>a[i] && a[k]+a[i]>a[j] &&a[i]!=a[j] 
            && a[i]!=a[k] && a[j]!=a[k]){
                ans++;
            }
        }
    }
}
cout<<ans<<endl;
}

Measured memory_bytes: 3636
#include<stdio.h>
int main(){
    int X,Y;
    int sum = 0;
    scanf("%d %d",&X,&Y);

    if(X==3){
        sum+=100000;
    }
    if(Y==3){
        sum+=100000;
    }
    if(X==2){
        sum+=200000;
    }
    if(Y==2){
        sum+=200000;
    }
    if(X==1){
        sum+=300000;
    }
    if(Y==1){
        sum+=300000;
    }
    if(sum==600000){
        sum+=400000;
    }

    printf("%d\n",sum);
}

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

using namespace std;

typedef long long ll;
typedef long long unsigned int llui;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< vector<int> > vvi;
typedef set<int> si;
typedef map<string, int> msi;
typedef map<int, int> mii;

#define INF 1000000000
#define MOD 1000000007
#define EPS 1e-9
#define DEBUG(x) cout<< '>' << #x << ':' << x << "\n";
#define ALL(x) (x).begin(), (x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define UNIQUE(x) SORT(x),(x).erase(unique((x).begin(),(x).end()),(x).end())
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define SZ(a) int((a).size())
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a,b) memset(a,b,sizeof(a))

#define FOR(i,a,b) for (int i = int(a); i < int(b); i++)
#define FORD(i,a,b) for(int i=int(b)-1; i>=int(a); i--)
#define REP(i, n) for (int i = 0; i < int(n); i++)
#define REP1(i,n) for (int i = 1; i <= int(n); i++)
#define REV(i, n) for (int i = int(n)-1; i >=0 ; i--)

#define sd(n) scanf("%d",&n)
#define dsd(n) int n; scanf("%d",&n)
#define sd2(a,b) scanf("%d%d",&a,&b)
#define dsd2(a,b) int a,b; scanf("%d%d",&a,&b)
#define pd(n) printf("%d\n",n)
#define pds(n) printf("%d ",n)
#define sll(n) scanf("%lld",&n)
#define dsll(n) ll n; scanf("%lld",&n)
#define sll2(a,b) scanf("%lld%lld",&a,&b)
#define dsll2(a,b) ll a,b; scanf("%lld%lld",&a,&b)
#define pll(n) printf("%lld\n",n)	
#define plls(n) printf("%lld ",n)	
#define print(x) cout<< x << "\n"

#define trace(x) cout << '>' << #x << ':' << x << "\n"
#define trace2(x,y) cout<< '>' << #x << ':' << x << " | " << #y << ':' << y << "\n"
#define trace3(a,b,c) cout<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define trace4(a,b,c,d) cout<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"

inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void set_bit(int & n, int b) { n |= two(b); }
inline void unset_bit(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }

#define LSOne(S) (S&(-S))

const double pi = acos(-1);
const int oo = 0x3f3f3f3f;

int cmp(double x, double y = 0, double tol = EPS) {
    return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}

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

const int MAX_N = 1000010;
//int arr[MAX_N];

int main(){
    dsll(K);dsll2(A,B);
    ll ans=1,t,ans1=1+K;
    t=min(A-1,K);
    K-=t;
    ans+=t;
    t=K%2;
    ans+=(K/2)*(B-A);
    ans+=t;
    pll(max(ans,ans1));
	return 0;
}


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

int main()
{
    int n;
    cin>>n;
    string str;
    cin>>str;
    vector<char>f_str;
    int i;
    char c=str[0];
    f_str.emplace_back(c);
    for(i=1;i<n;++i){
        if(str[i]==c) continue;
        else{
            f_str.emplace_back(str[i]);
            c=str[i];
        }
    }
    cout<<f_str.size();
    return 0;
}

Measured memory_bytes: 640
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_E main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
// functions

#endif


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

    int N;  cin >> N;
    vi A(N);
    REP(i, N) cin >> A[i];
    
    deque<int> dq;
    REP(i,N) {
        int j = lower_bound(dq.begin(), dq.end(), A[i]) - dq.begin();
        if (j == 0) dq.push_front(A[i]);
        else dq[j - 1] = A[i];
    }

    int ans = dq.size();
    cout << ans << endl;

    return 0;
}

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

const ll mod = 998244353;
struct mint {
    ll x;  // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    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 {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

struct combination {
    vector<mint> fact, ifact;
    // init struct with "n" of "nCk" (maximum number in other words)
    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;
    }
    // c(n,k) returns mint that contains nCk (mod p (= 1e9+7)) in x
    // i.e.) mint num = c(n,k), then num.x == nCk (mod p (= 1e9+7))
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }

    // nPk - permutation
    mint p(int n, int k) {
        return fact[n] * ifact[n - k];
    }
};

const int maxn = 3030;
ll a[maxn];
mint dp[maxn][maxn];

int main() {
    int n, s;
    cin >> n >> s;
    rep(i, n) cin >> a[i];

    dp[0][0] = 1;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j <= s; j++) {
            dp[i + 1][j] += dp[i][j] * 2;
            if (j + a[i] <= s) {
                dp[i + 1][j + a[i]] += dp[i][j];
            }
        }
    }
    cout << dp[n][s].x << endl;
}

Measured memory_bytes: 75216
n, a = gets.chomp.split.map(&:to_i)
x = gets.chomp.split.map(&:to_i)
m = 50
dp = Array.new(n + 1) {  Hash.new(0) }
dp[0][0] = 1

n.times do |t|
  prev = dp[t].keys
  prev.each do |j|
    dp[t + 1][j] += dp[t][j]
    dp[t + 1][j + x[t] - a] += dp[t][j]
  end
end
puts dp[n][0] - 1

Measured memory_bytes: 15212
package main

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

var rdr = bufio.NewReaderSize(os.Stdin, 10000)

func readLine() string {
	buf := make([]byte, 0, 10000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func main() {
	input := strings.Split(readLine(), " ")
	a, _ := strconv.Atoi(input[0])
	b, _ := strconv.Atoi(input[1])
	c, _ := strconv.Atoi(input[2])

	if a < b {
		if a < c && c < b {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	} else {
		if a > c && c > b {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define _GLIBCXX_DEBUG
#define rep(i, c) for (int i = 0; i < (int)c; i++)
#define debug(x) cout << #x << " = " << x << endl
#define print(x) cout << x << endl;
const ll MOD = 1000000007;

vector<ll> ans;

struct node
{
    ll id;
    ll cost;   // The cost to arrive at this node
    ll parent; // Not used for now
    node(ll _id, ll _cost)
    {
        id = _id;
        cost = _cost;
    }
};

bool operator<(const node &left, const node &right)
{
    return left.cost < right.cost;
}

bool operator>(const node &left, const node &right)
{
    return left.cost > right.cost;
}

struct edge
{
    ll to;
    ll cost;
    edge(ll _to, ll _cost)
    {
        to = _to;
        cost = _cost;
    }
};

struct Graph
{
    ll V;
    vector<vector<edge>> edges;

    // V is the number of vertices
    Graph(ll _V)
    {
        // init
        V = _V;
        rep(i, V)
        {
            edges.push_back({});
        }
    }

    void addEdge(ll u, ll v, ll w)
    {
        edges[u].push_back(edge(v, w));
    }

    // O((E+N)logN)
    vector<ll> dijkstra(ll s) // s: starting vertex
    {

        // init min distance vector
        // d[i] is the minimum distance from s to i
        vector<ll> d(V);
        rep(i, V)
        {
            d[i] = LLONG_MAX;
        }

        // the top element is the vertex with the smallest cost
        priority_queue<node, vector<node>, greater<node>> q;

        // init start vertex
        d[s] = 0;
        q.push(node(s, 0));

        // update
        while (!q.empty())
        {
            node n = q.top();
            q.pop();

            // cout << "Now at node " << n.id << endl;

            // Check all the node which connects with n
            for (edge e : edges[n.id])
            {
                // cout << "Searching edge from " << n.id << " to " << e.to << endl;
                ll cand = d[n.id] + e.cost; // Cost via n
                // cout << "Candidate cost to " << e.to << " is " << cand << endl;

                if (cand < d[e.to])
                {
                    // cout << "Update cost for " << e.to << " to " << cand << endl;
                    d[e.to] = cand;
                    // cout << "Mejirushi for " << e.to << "is" << n.id << endl;
                    ans[e.to] = n.id;
                    q.push(node(e.to, cand)); // If via n is better, this may improve the shortest cost so need check
                }
            }
        }

        return d;
    }
};

int main()
{
    ll N, M;
    cin >> N >> M;

    Graph graph(N);
    rep(i, M)
    {
        ll temp, temp2;
        cin >> temp >> temp2;
        temp--;
        temp2--;
        graph.addEdge(temp, temp2, 1);
        graph.addEdge(temp2, temp, 1);
        ans.push_back(-1);
    }

    graph.dijkstra(0);

    cout << "Yes" << endl;
    rep(i, N - 1)
    {
        cout << ans[i + 1] + 1 << endl;
    }
}


Measured memory_bytes: 21976
#include<cstdio>
#include<iostream>
using namespace std;
int a[100],b[100];
int main()
{
	int n,m;
	int ans1;
	cin>>n>>m;
	for(int i=0;i<m;i++)
	   cin>>a[i]>>b[i];
	for(int j=0;j<n;j++)
	{
		ans1=0;
		for(int i=0;i<m;i++)
		{
			if(a[i]==j+1||b[i]==j+1)
			    ans1++;
		}
	    cout<<ans1<<endl;
	}
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
	string a, s, c;
	cin >> a >> s >> c;
	cout << 'A' << s[0] << 'C' << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> ti;
 
#define REP(a,b,c) for(ll a=b;a<(c);a++)
#define PER(a,b,c) for(ll a=b;a>=(c);a--)
 
inline ll ii(){ ll x; cin >> x; return x; }
inline string is(){ string x; cin >> x; return x; }
inline ld id(){ ld x; cin >> x; return x; }
inline void oi(ll x){ cout << x; }
inline void od(ld x){ cout << fixed << setprecision(10) << x; }
inline void os(string x){ cout << x; }
inline void oe(){ cout << endl; }
inline void oie(ll x){ oi(x); oe(); }
inline void ode(ld x){ od(x); oe(); }
inline void ose(string x){ os(x); oe(); }
inline void maxin(ll &a, ll b){ a=max(a,b); }
inline void minin(ll &a, ll b){ a=min(a,b); }

ll m[1123][2123];
ll mod=1e9+7;

int main(){
    ll S=ii();
    ll ret = 0;
    m[0][0]=1;
    REP(i,0,667){
        ll s=0;
        REP(k,0,S-3+1){
            s+=m[i][k];
            if(k+3==S){
                ret+=s;
                ret%=mod;
            }else{
                m[i+1][k+3]+=s;     
                m[i+1][k+3]%=mod;     
            }
        }
    }
    oie(ret);

    return 0;
}

Measured memory_bytes: 14492
#include<bits/stdc++.h>
#define FOR0(i,n) for(i=0;i<n;i++)
#define FOR(i,j,n) for(i=j;i<n;i++)
#define FORD(i,j,k) for(i=j;i>=k;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 1000000000
#define ninf -1000000000
#define endl '\n' 
#define she_told_me_dont_worry ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
// Use cout.flush() for interactive problems.
inline long long  MAX2(long long  a, long long int b){return (a)>(b)?(a):(b);}
inline long long  MAX3(long long  a, long long  b,long long  c){return (a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c));}
inline long long  MIN2(long long  a, long long  b){return (a)<(b)?(a):(b);}
inline long long  MIN3(long long  a, long long b,long long c){return (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c));}
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;
double p[3005];
double dp[3005][3005];
int n;
double compute(int i, int cur)
{
    if(i == n)
    {
        if( 2*cur -n > 0)
            return 1;
        else return 0;
    }
    if( fabs(dp[i][cur]+1) >= 1e-9)
        return dp[i][cur];
    double ans = 0;
    ans += p[i]*compute(i+1, cur+1);
    ans += (1-p[i])*compute(i+1, cur);
    return dp[i][cur] = ans;
}
int main()
{
    she_told_me_dont_worry
    cin>>n;
    int i, j;
    FOR0(i, n+5)FOR0(j, n+5) dp[i][j] = -1;
    FOR0(i, n) 
        cin>>p[i];
    cout<<setprecision(11)<<compute(0, 0);
    cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
}

Measured memory_bytes: 71040
from operator import itemgetter
n = int(input())
x = list(map(int, input().split()))

x = [(j, i) for i, j in enumerate(x)]
x.sort(key=itemgetter(0))
medi1 = x[len(x)//2][0]
medi2 = x[len(x)//2-1][0]
ans = [0]*n
for i in range(len(x)):
    if i<len(x)//2:
        ans[x[i][1]] = medi1
    else:
        ans[x[i][1]] = medi2

for a in ans:
    print(a)

Measured memory_bytes: 111560
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vs){
  for (const T& v : vs) os << v << " ";
  return os;
}

int main() {
  int H, W, M; cin >> H >> W >> M;
  vector<int> R(H, 0), C(W, 0);
  set<pair<int, int>> bumb;
  for (int i = 0; i < M; ++i) {
    int h, w; cin >> h >> w; --h, --w;
    R[h]++, C[w]++;
    bumb.insert({h, w});
  }

  vector<int> rs, cs;
  int rmax = 0, cmax = 0;
  for (int r = 0; r < H; ++r) {
    if (rmax < R[r]) {
      rs = {r};
      rmax = R[r];
    } else if (rmax == R[r]) {
      rs.push_back(r);
    }
  }
  for (int c = 0; c < W; ++c) {
    if (cmax < C[c]) {
      cs = {c};
      cmax = C[c];
    } else if (cmax == C[c]) {
      cs.push_back(c);
    }
  }

  for (int r : rs) {
    for (int c : cs) {
      if (!bumb.count({r, c})) {
        cout << rmax + cmax << endl;
        return 0;
      }
    }
  }
  cout << rmax + cmax - 1 << endl;
}


Measured memory_bytes: 23872
N=int(input())
a=map(int,input().split())
c=0
d=0
e=0
f=0
for i in a:
  if i%4==0:
    c=c+1
  elif i%2==0:
    d=d+1
  e=N-c-d
if d==0:
  if (c+1)>=e:
    print('Yes')
  else:
    print('No')
    
else:
  if c>=e:
    print('Yes')
  else:
    print('No')

Measured memory_bytes: 16792
x = [int(input()) for i in range(5)]
mintime = 100000
for i in range(5):
    for j in range(5):
        for p in range(5):
            for q in range(5):
                for w in range(5):
                    time = 0
                    if i != j and i != p and i != q and i != w and j != p and j != q and j != w and p != q and p != w and q != w:
                        time += x[i]
                        if time % 10 != 0:
                            time += (10 - (time % 10))
                        time += x[j]
                        if time % 10 != 0:
                            time += (10 - (time % 10))
                        time += x[p]
                        if time % 10 != 0:
                            time += (10 - (time % 10))
                        time += x[q]
                        if time % 10 != 0:
                            time += (10 - (time % 10))
                        time += x[w]
                        if time < mintime:
                            mintime = time
print(mintime)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long t,n,x;
  cin >> n >> x >>t;
  int k=n/x;
  if(n%x!=0)
  {
      cout << t*(k+1) <<endl; 
  }
  else 
  {
      cout << t*k <<endl;
  }
   
  return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define INFTY 1<<20
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
const int MOD=1000000007;

int main(){
double w,h,x,y;
cin>>w>>h>>x>>y;
double ans;
ans = w*h/2.0;

if(x==w/2&&y==h/2)printf("%.10lf 1",ans);
else printf("%.10lf 0",ans);
return 0;
}

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

#define sz(x) (int)(x.size())
#define FOR(i,L,R) for(int i = L; (L <= R? i <= R : i >= R); (L <= R? i += 1 : i -= 1))
#define int long long

const int N = 2e5 + 2, inf = 1e18;

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

    int x, k, d;
    cin >> x >> k >> d;
    int pos = abs(x);
    int moves = pos/d;
    if(k < moves) {
        cout << min(abs(x + k * d), abs(x - k * d));
        return 0;
    }

    int ans = inf;
    int rem = k - moves;
    int now_pos = (x < 0 ? x + moves * d : x - moves * d);
    if(rem % 2 == 1) {
        ans = min({ans, abs(now_pos + d), abs(now_pos - d)});
    }else {
        ans = min({ans, abs(now_pos)});
    }
    cout << ans;
}


Measured memory_bytes: 3608
using System;

namespace AIZU {
	class Program {
		static int cin(int D) {
			string s = Console.ReadLine();
			if (string.IsNullOrEmpty(s))
				return D;
			return int.Parse(s);
		}
		static void print(object j) { Console.WriteLine(j.ToString()); }

		static void Main(string[] args)
		{
			int x;
			while (true) {
				x = cin(-1);
				if (x == -1)
					break;
				print(x*(x+1)/2+1);
			}
		}
	}
}

Measured memory_bytes: 9056
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
bool eq(ld a, ld b) {
	return (abs(a - b) < eps);
}
ld cross(Point a, Point b) {
	return imag(conj(a)*b);
}
class Line {
public:
	Point a, b;
};
bool well_ll(Line s, Line t) {
	Point sv = s.b - s.a; Point tv = t.b - t.a;
	if (abs(cross(tv, sv)) < eps)return false;
	return true;
}
Point is_ll(Line s, Line t) {
	Point sv = s.b - s.a; Point tv = t.b - t.a;
	return s.a + sv * cross(tv, t.a - s.a) / cross(tv, sv);
}
bool isis_sp(Line s, Point p) {
	return (abs(s.a - p) + abs(s.b - p) - abs(s.b - s.a) < eps);
}
bool comp(pair<Point,int> x, pair<Point,int> y) {
	Point p = x.first; Point q = y.first;
	if (real(p) < real(q))return true;
	if (eq(real(p), real(q)) && imag(p) < imag(q))return true;
	return false;
}
int main() {
	int aaaaa; cin >> aaaaa;
	rep(i, aaaaa) {
		ld x, y, z, w; cin >> x >> y >> z >> w;
		Line bas = { {x,y},{z,w} };
		int ud,compa;
		vector<pair<Point, int>> v;
		int n; cin >> n;
		rep(i, n) {
			cin >> x >> y >> z >> w >> compa >> ud;
			Line alr = { {x,y},{z,w} };
			if (well_ll(bas, alr)) {
				Point cap = is_ll(bas, alr);
				if (isis_sp(bas, cap) && isis_sp(alr, cap)) {
					v.push_back({ cap,compa^ud });
				}
			}
		}
		sort(v.begin(), v.end(),comp);
		int len = v.size();
		int out = 0;
		if (len != 0) {
			int now = v[0].second;
			Rep(i, 1, len) {
				if (now != v[i].second) {
					now = v[i].second; out++;
				}
			}
		}
		cout << out << endl;
	}
	return 0;
}


Measured memory_bytes: 3288
def cracker(n):
    i = 0
    while True:
        r = (n - i * 4)
        if r < 0:
            print('No')
            return
        if (n - i * 4) % 7 == 0:
            print('Yes')
            return
        i += 1
n = int(input())
cracker(n)


Measured memory_bytes: 2940
# include <bits/stdc++.h>
using namespace std;
# define eps 1e-8
# define INF 1e20
# define pi  acos(-1.0)
# define MX  1005

int main()
{
    int a,b;
    int s=1;
    scanf("%d%d",&a,&b);
    while (a--)
    {
        int ta = s*2, tb =s+b;
        s = min(ta,tb);
    }
    printf("%d\n",s);
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());

		sc.close();



		if(a * a * b >= 2 * x) {
			double l = (double)a * b * b / (2 * x);
			System.out.println(Math.toDegrees(Math.atan(l)));
		}else {
			double l2 = (double)b * 2 / a - (double) x * 2 / (a * a * a);
			System.out.println(Math.toDegrees(Math.atan(l2)));
		}


	}
}



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

using namespace std;

#define REP(var, n)  for (decltype(n) var = 0; var < (n); var++)
#define RREP(var, n)  for (auto var = n - 1; var != static_cast<decltype(var)>(-1); var--)
#define FOR(var, a, b)  for (auto var = (a); var < (b); var++)
#define RFOR(var, a, b)  for (auto var = b - 1; var != a; var--)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;

#define all(c) begin(c),end(c)

#define D(x) do { std::cerr << x; } while (0)
#define D2(x) do { std::cerr << #x << ": " << x << std::endl; } while (0)


template<typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
    if (!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}


template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    return os << '(' << p.first << ',' << p.second << ')';
}


ll gcd(ll a, ll b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}

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

auto solve() {
    int n, m;
    cin >> n >> m;
    string s, t;
    cin >> s >> t;

    ll len = lcm(n, m);

    unordered_map<ll, char> co;
    REP(i, n) {
        ll ii = i * (len / n);
        if (co.count(ii) == 0) {
            co[ii] = s[i];
        } else {
            if (co[ii] != s[i]) return -1ll;
        }
    }
    REP(i, m) {
        ll ii = i * (len / m);
        if (co.count(ii) == 0) {
            co[ii] = t[i];
        } else {
            if (co[ii] != t[i]) return -1ll;
        }
    }

    return len;
}


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

//    cout << (solve() ? "Yes" : "No") << endl;
    cout << solve() << endl;
//    solve();

    return 0;
}


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

const long mod = 1000000007;

long fact[200001];

long pow(long a, long b)
{
  if (b == 0)
    return 1;
  if (b % 2 == 0)
  {
    long half = pow(a, b / 2);
    return half * half % mod;
  }
  else
  {
    return a * pow(a, b - 1) % mod;
  }
}

void calc_fact_table()
{
  for (int i = 1; i <= 200000; i++)
  {
    fact[i] = fact[i - 1] * i % mod;
  }
}

long calc_inv(long n)
{
  return pow(n, mod - 2);
}

long calc_comb(long n, long r)
{
  if (n - r < r)
    return calc_comb(n, n - r);
  return fact[n] * calc_inv(fact[n - r] * fact[r] % mod) % mod;
}

int main()
{
  long H, W, A, B;
  cin >> H >> W >> A >> B;
  fact[0] = 1;
  calc_fact_table();
  long ans = 0;
  for (int i = 0; i < W - B; i++)
  {
    ans += calc_comb(H - A - 1 + B + i, H - A - 1) * calc_comb(A - 1 + W - B - 1 - i, A - 1) % mod;
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1792
function Main(input) {
  input = input.split("\n");
  var n = parseInt(input[0], 10);
  var v = input[1].split(" ");
  var c = input[2].split(" ");
  var t = [];
  var a = 0;
  for (var i = 0; i < n; i++) {
    t.push(v[i] - c[i]);
  }
  t.sort(
    function(a,b){
      return (a < b ? 1 : -1);
    }
  );
  for (var i = 0; i < n; i++) {
    if (t[i] > 0) {
      a += t[i];
    }
  }
  console.log('%d',a);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner();

        int N = in.nextInt();
        int X = in.nextInt();

        ArrayList<Integer> m = new ArrayList<>();
        for (int i =0; i< N;i++)
        {
            m.add(in.nextInt());
        }
        int sum = 0;
        Collections.sort(m);
        for (int i = 0; i < N; i++)
        {
            sum+= m.get(i);
        }
        int count = N;
        X= X-sum;


        while(X-m.get(0)>=0)
        {
            X-= m.get(0);
            count++;
        }

        System.out.println(count);
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return null;
        }

        int nextInt() {
            return Integer.parseInt(nextToken());
        }

        long nextLong() {
            return Long.parseLong(nextToken());
        }

        double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}


Measured memory_bytes: 21204
import itertools

N = int(input())
P = list(map(str,input().split()))
Q = list(map(str,input().split()))
num = list(map(str,range(1,N+1)))
nums = [''.join(v) for v in itertools.permutations(num)]

snums = sorted(nums)
Pnum = ''.join(P)
Qnum = ''.join(Q)
ans = abs(snums.index(Pnum)-snums.index(Qnum))
print(ans)

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

int main() {
  int N;
  cin >>N;
  vector<int> L(N);
  for(int i=0;i<N;i++){
    cin >>L.at(i);
  }
  sort(L.begin(),L.end());
  int sum=0;
  for(int i=0;i<N-1;i++){
    sum+=L.at(i);
  }
  if(sum>L.at(N-1)){
    cout <<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

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

int n, w, a[105], b[105];
long long dp[100005];
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

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

	for (int i = 1; i <= n; i++) {
		for (int j = w; j >= 0; j--) {
			if (j >= a[i]) dp[j] = max(dp[j], dp[j - a[i]] + b[i]);
			dp[j] = max(dp[j], dp[j - 1]);
		}
	}

	cout << dp[w] << '\n';

	return 0;
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

int main(){
int N,K;
  cin >> N >> K;
int number = 1; 
for(int i=1; i<=N;++i){
	if(number*2 < number+K){
		number = number*2;
	}
    else{
		number = number+K;
	}
}
cout << number << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
/*
最大でも総和か
総和-MAXが動かす最大回数
N=500なら全探索か
Kがでかいからだめか
総和の約数について全通りしらべるかな
4 5
10  1  2 22

+4 +6 +5 +6
-3 -1 -2 -1
差分とる、マイナスの小さいほうからとって、残りのプラスの総和と等しくなったら手数
*/
int main(){
  ll N,K; cin>>N>>K;
  vector<ll> A(N,0),B;
  vector<pair<ll,ll>> P(N,make_pair(0,0));
  for(ll i=0; i<N; i++) cin>>A[i];
  ll high=0, sum=0;
  for(ll i=0; i<N; i++){
    sum+=A[i];
    high=max(high,A[i]);
  }
  //Bに約数入れる
  ll end=sqrt(sum);
  for(ll i=1; i<=end; i++){
    if(sum%i==0){
      B.emplace_back(i);
      if(i==sum/i) break;
      B.emplace_back(sum/i);
    }
  }
  sort(B.begin(), B.end(), greater<ll>());
  ll Bsz=B.size();
  for(ll i=0; i<Bsz; i++){
  //プラマイ表つくる
    ll Psum=0, Lsum=0;
    for(ll j=0; j<N; j++){
      ll L=A[j]%B[i];
      P[j].first=B[i]-L;
      P[j].second=L;
      Psum+=P[j].first;
    }
    sort(P.begin(), P.end(), [](auto& x, auto& y){return x.second < y.second;});
    ll k=K, n=0;
    while(k>=0 && Psum!=Lsum){
      Psum-=P[n].first;
      Lsum+=P[n].second;
      k-=P[n].second;
      n++;
    }
    if(k>=0){
      cout<<B[i]<<endl;
      return 0;
    }
  }
}

Measured memory_bytes: 256
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int K = sc.nextInt();
		
		sc.close();

		out.println((int) (K*Math.pow(K-1,N-1)));
		
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
	
	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray1origin(Scanner sc, int n) {
		int[] result = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
}


Measured memory_bytes: 21972
#!/usr/bin/env python3
# -*- coding: utf-8 -*-



def main():
    w = int(input())
    n = int(input())

    xs = [i for i in range(w+1)]
    for _ in range(n):
        a, b = map(int, input().split(","))

        xs[a], xs[b] = xs[b], xs[a]

    for i in range(1, w+1):
        print(xs[i])

if __name__ == "__main__": main()

Measured memory_bytes: 7660
import math
N=math.factorial(int(input()))
i=2
ans=1
M=10**9+7
while i*i<=N:
    cnt=1
    while N%i==0:
        cnt+=1
        N//=i
    ans*=cnt
    i+=1
if N!=1:ans*=2
print(int(ans%M))

Measured memory_bytes: 38640
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];

int main(){
  int K,S;
  cin >> K >> S;
  int ans=0 ;
  for(int i=0;i<=K;i++){
    for(int j=0;j<=K;j++){
      if(0 <= S-i-j && S-i-j <= K)
        ans ++ ;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
from itertools import combinations

n,k = map(int,input().split())
A = list(map(int,input().split()))

ans = 10**12
for cmb in combinations(range(1,n),k-1):    
  cost = 0
  h = A[0]
  
  for i in range(1,n):    
    if i in cmb: 
      if A[i] > h:        
        h = A[i]      
      else:
        cost += h - A[i] + 1
        h += 1    
    h = max(h,A[i])
        
  ans = min(ans,cost)
          
print(ans)  

Measured memory_bytes: 3064
// This code wrote by chtholly_micromaker(MicroMaker)
#pragma GCC optimize("Ofast,O3,inline")
#pragma GCC target("avx,avx2")
#include <bits/stdc++.h>
#define reg register
#define int long long
#define ALL(x) (x).begin(),(x).end()
#define mem(x,y) memset(x,y,sizeof x)
#define sz(x) (int)(x).size()
#define ln puts("")
#define lsp putchar(32)
#define pb push_back
#define MP make_pair
#define dbg(x) cerr<<">"<<__func__<<"\tLine: "<<__LINE__<<' '<<#x<<": "<<x<<endl
using namespace std;
const int MaxN=200050;
template <class t> inline void read(t &s){s=0;
reg int f=1;reg char c=getchar();while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
while(isdigit(c))s=(s<<3)+(s<<1)+(c^48),c=getchar();s*=f;return;}
template<class t,class ...A> inline void read(t &x,A &...a){read(x);read(a...);}
template <class t> inline void write(t x){if(x<0)putchar('-'),x=-x;
int buf[21],top=0;while(x)buf[++top]=x%10,x/=10;if(!top)buf[++top]=0;
while(top)putchar(buf[top--]^'0');return;}
inline void setIn(string s){freopen(s.c_str(),"r",stdin);return;}
inline void setOut(string s){freopen(s.c_str(),"w",stdout);return;}
inline void setIO(string s=""){setIn(s+".in");setOut(s+".out");return;}
template <class t>inline bool checkmin(t&x,t y){if(x>y){x=y;return 1;}return 0;}
template <class t>inline bool checkmax(t&x,t y){if(x<y){x=y;return 1;}return 0;}
inline int lowbit(int x){return x&(-x);}
int n;
int a[MaxN];
vector<pair<int,int> > o;
inline void print()
{
	for(auto v:o)
		printf("%lld %lld\n",v.first,v.second);
	return;
}
signed main(void)
{
	vector<int> dr1,dr2;
	read(n);
	for(int i=1;i<=n;++i)
	{
		read(a[i]);
		if(a[i]>=0)
			dr1.pb(a[i]);
		else
			dr2.pb(a[i]);
	}
	sort(ALL(dr1));
	sort(ALL(dr2));
	if(!sz(dr1))
	{
		for(int i=0;i<sz(dr2)-1;++i)
			o.pb(MP(dr2[n-1],dr2[i])),dr2[n-1]-=dr2[i];
		write(dr2[n-1]),ln;
		print();
		return 0;
	}
	if(!sz(dr2))
	{
		for(int i=1;i<sz(dr1)-1;++i)
			o.pb(MP(dr1[1],dr1[i])),dr1[1]-=dr1[i];
		o.pb(MP(dr1[n-1],dr1[1]));
		dr1[n-1]-=dr1[1];
		write(dr1[n-1]),ln;
		print();
		return 0;
	}
	for(int i=0;i<sz(dr1)-1;++i)
		o.pb(MP(dr2[0],dr1[i])),dr2[0]-=dr1[i];
	for(int i=0;i<sz(dr2);++i)
		o.pb(MP(dr1.back(),dr2[i])),dr1.back()-=dr2[i];
	write(dr1.back()),ln;
	print();
	return 0;
}

/*
 * Check List:
 * 1. Input / Output File (USACO and OI and UVa)
 * 2. long long 
 * 3. Special Test such as n=1
 * 4. Array Size
 * 5. Memory Limit (OI) int is 4 and longlong is 8
 * 6. Mod (a*b%p*c%p not a*b*c%p  ,  (a-b+p)%p not a-b )
 * 7. Name ( int k; for(int k...))
 * 8. more tests , (T=2 .. more)
 * 9. blank \n after a case
*/






Measured memory_bytes: 7948
#include <stdio.h>

long long pate(long long burger[], long long p[], int n, long long x);

int main(void)
{
	int n;
	long long x, p[51], burger[51], ans;
	scanf("%d%lld", &n, &x);
	p[0]=1;
	burger[0]=1;
	for (int i = 1; i <= n; ++i) p[i]=2*p[i-1]+1;
	for (int i = 1; i <= n; ++i) burger[i]=2*burger[i-1]+3;
	ans=pate(burger, p, n, x);
	printf("%lld\n", ans);
	return 0;
}

long long pate(long long burger[], long long p[], int n, long long x)
{
	long long ans;
	if (x>=burger[n]-n)
	{
		ans=p[n];
	}
	else if (x>burger[n-1]+2)
	{
		x=x-burger[n-1]-2;
		ans=p[n-1]+pate(burger, p, n-1, x)+1;
	}
	else if (x==burger[n-1]+2)
	{
		ans=p[n-1]+1;
	}
	else if (x>n)
	{
		ans=pate(burger, p, n-1, x-1);
	}
	else
	{
		ans=0;
	}
	return ans;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;

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

       int t=1;
       //cin>>t;
       while(t--)
       {
            string s;
            cin>>s;
            int a[26] = {};
            for(int i=0;i<s.size();++i)
            {
                 a[s[i]-'a']++;
            }

            for(int i=0;i<26;++i)
            {
                 if(a[i]%2)
                 {
                      cout<<"No";
                      return 0;
                 }
            }
            cout<<"Yes";
       }
}


Measured memory_bytes: 3540