akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define all(in) in.begin(), in.end()
#define INF (sizeof(int) == 4 ? (int)1e9:(int)1e18)
#define EPS 0.0000000001
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
signed main(){
    int n,k; cin >> n >> k;
    vector<int>v(n);
    for(auto & e : v) cin >> e;
    auto dp = vectors(n,n,k,-INF);
    if(k == 1 or n == 1){
        cout << max({v.front(),v.back(),0LL}) << endl;
        return 0;
    }
    dp[1][n - 1][k -  1] = v.front();
    dp[0][n - 2][k -  1] = v.back();
    if(v.front() < 0 and k >= 2){
        dp[1][n - 1][k - 2] = 0LL;
    } else if(v.back() < 0 and k >= 2){
        dp[0][n - 2][k - 2] = 0LL;
    }
    auto valid = [&](int l,int r){ return (l <= r and 0 <= l and  r <= n-1);};
    for(int l = 0; l < n; ++l){
        for(int r = n - 1; r >= 0; --r){
            for(int cst = 1; cst < k; ++cst){
                if( dp[l][r][cst] == -INF) continue;
                // l and r  is same !!
                int now = dp[l][r][cst];
                if( valid(l + 1,r) )
                    cmax(dp[l + 1][r][cst - 1],now + v[l]);
                if( valid(l,r - 1) )
                    cmax(dp[l][r - 1][cst - 1],now + v[r]);
                if(v[l] < 0 and  valid(l + 1,r) and cst >= 2)
                    cmax(dp[l + 1][r][cst - 2],now);
                if(v[r] < 0 and valid(l,r - 1) and cst >=2)
                    cmax(dp[l][r - 1][cst - 2],now);
            }
        }
    }
    int ans = 0;
    for(int l = 0; l < n; ++l){
        for(int r = 0; r < n; ++r){
            for(int cst = 0; cst < k; ++cst){
                cmax(ans,dp[l][r][cst]);
                if(l == r){
                    cmax(ans,dp[l][r][cst] + (cst != 0 and v[l] > 0 ? v[l] : 0));
                }
            }
        }
    }
    cout << ans << endl;
}



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

int main(){
  int N;
  cin >> N;
  vector<int> l(N);
  
  for(auto& t:l)
    cin >> t;
  
  sort(l.begin(),l.end());
  
  int i,j,k,ct;
  ct = 0;
  if (N>2)
  for(i=0;i<N-2;i++)
    for(j=i+1;j<N-1;j++)
      if (l[i] != l[j])
        for(k=j+1;k<N;k++)
          if (l[j] != l[k])
            if (l[i]+l[j] > l[k])
              ct++;
  
  cout << ct << endl;
  
  return 0;
}

Measured memory_bytes: 3628
import java.util.Scanner;

public class Main {
  static Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    int N = sc.nextInt();
    int[] P = new int[N];
    for (int i = 0; i < N; i++) {
      P[i] = sc.nextInt() - 1;
    }
    int[] A = new int[N];
    int[] B = new int[N];
    for (int i = 0; i < N; i++) {
      A[i] = 30000 * (i + 1);
      B[i] = 30000 * (N - i);
    }
    for (int i = 0; i < N; i++) {
      B[P[i]] -= (N - i);
    }
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < N; i++) {
      if (i != 0) sb.append(" ");
      sb.append(A[i]);
    }
    sb.append("\n");
    for (int i = 0; i < N; i++) {
      if (i != 0) sb.append(" ");
      sb.append(B[i]);
    }
    System.out.println(sb);
  }
}


Measured memory_bytes: 30212
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N,K;
  cin >> N >> K;
  vector<int> A(N);
  for(int i=0;i<K;i++){
    int d;
    cin >> d;
    for(int j=0;j<d;j++){
      int a;
      cin >> a;
      A.at(a-1)++;
    }
  }
  
     int ans; 
  for(int k=0;k<N;k++){
	if(A.at(k)==0){
      ans++;
    }
  }
  
  cout << ans <<endl;
}



Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <sstream>

using namespace std;


int main(int argc, const char * argv[]) {
    const int DISHES_NUM = 5;

    int total = 0;
    int residue = 10;
    for (int i = 0; i < DISHES_NUM; i++) {
        int tmp; cin >> tmp;
        if (tmp % 10 == 0) {
            total += tmp;
        } else {
            total += 10 * (tmp / 10);
            total += (residue % 10 == 0) ? 0 : 10;
            if (tmp % 10 < residue) {
                residue = tmp % 10;
            }
        }
    }
    cout << total + (residue % 10) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
int main() {
	int N,K;
	cin >> N >> K;
	vector<int> h(N);
	for (int i = 0; i < N; i++) {
		cin >> h[i];
	}
	int rec = 0;
	for (int i = 0; i < N; i++) {
		if (h[i] >= K) {
			rec++;
		}
	}
	cout << rec << endl;
	return 0;
}

Measured memory_bytes: 640
using System;
using System.Collections.Generic;

namespace abc163
{
    class Program
    {
        static void Main()
        {
            var nk = Console.ReadLine().Split(' ');
            var n = long.Parse(nk[0]);
            var k = long.Parse(nk[1]);
            var total = 0L;
            for (long i = k; i <= n + 1; ++i)
            {
                total += i * n - i * i + i + 1;
            }
            Console.WriteLine(total % 1000000007);
        }
    }
}


Measured memory_bytes: 17880
#include <bits/stdc++.h>
#define int llint
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, a, n) &((x)[a]), &((x)[n])
#define ADD(a, b) ((((a+MOD)%MOD)+((b+MOD)%MOD))%MOD)
#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define PI (acos(-1))
#define EPS (1e-10)
#define INF INT_MAX
#define INFLL LLONG_MAX
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using MCI = std::map<char, int>;
using VPII = std::vector<PII>;
using Complex = std::complex<double>;
using namespace std;


int N;
int a[200010];


int solve(){
	int ans = INF;
	int sum = accumulate(RNG(a, 0, N), 0LL);
	int x = 0;
	rep(i, 0, N-1) x += a[i], chmin(ans, abs(x-(sum-x)));
	return ans;
}


signed main(){
	cin >> N;
	rep(i, 0, N) cin >> a[i];

	cout << solve() << endl;

	return 0;
}

Measured memory_bytes: 1792
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<usize>();
    let (n, m) = (v[0], v[1]);
    let mut g = vec![0; n];
    for i in 0..m {
        let v = read_vec::<usize>();
        let (a, b) = (v[0] - 1, v[1] - 1);
        g[a] += 1;
        g[b] += 1;
    }
    for i in 0..n {
        println!("{}", g[i]);
    }
}

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

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


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

using namespace std;

int main() {
  int A, B;
  cin >> A >> B;

  if (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0) {
    cout << "Possible" << endl;
  } else {
    cout << "Impossible" << endl;
  }

  return 0;
}

Measured memory_bytes: 256
N = int(input())
cnt, ans = 0, 0
for i in range(1, N + 1):
    cnt = 0
    for j in range(1, i + 1):
        if i % j == 0: cnt += 1
    if (cnt == 8 and i % 2 == 1): ans += 1
print(ans)


Measured memory_bytes: 2940
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2186
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
int dp[16][16];
int t, gx, gy, p, a, b, c, d;
int main() {
    scanf("%d", &t);
    for (int r=0; r<t; r++) {
        scanf("%d%d%d",&gx,&gy,&p);
        vector<P> maps[16][16];
        memset(dp, 0, sizeof(dp));
        for (int i=0; i<p; i++) {
            scanf("%d%d%d%d",&a,&b,&c,&d);
            maps[a][b].push_back(P(c,d)); maps[c][d].push_back(P(a,b));
        }
        dp[0][0] = 1;
        for (int i=0; i<=gx; i++) {
            for (int j=0; j<=gy; j++) {
                if (i > 0) {
                    dp[i][j] += dp[i-1][j];
                    for (int k=0; k<maps[i][j].size(); k++) if (maps[i][j][k].first==i-1&&maps[i][j][k].second==j) {
                        dp[i][j] -= dp[i-1][j];
                        break;
                    }
                }
                if (j > 0) {
                    dp[i][j] += dp[i][j-1];
                    for (int k=0; k<maps[i][j].size(); k++) if (maps[i][j][k].first==i&&maps[i][j][k].second==j-1) {
                        dp[i][j] -= dp[i][j-1];
                        break;
                    }
                }
                // printf("%d ", dp[i][j]);
            }
            // puts("");
        }
        if (dp[gx][gy]==0) {
            puts("Miserable Hokusai!");
        } else {
            printf("%d\n",dp[gx][gy]);
        }
    }
}

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

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rep2(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

using namespace std;

signed main() {
  ll N;
  cin>>N;
  vector<ll> v(N);
  vector<ll> d(2*N, 0); // d[value]: その数字を最後尾とするソートされた数列の長さ
  rep(i,N) {
    cin>>v[i];
  }

  ll p = 0;
  rep(i,N) {
    d[v[i]] = d[v[i]-1]+1;
    // printf("i=%d value=%d numSorted=%d\n", i, v[i], d[v[i]]);
    p = max(p, d[v[i]]);
  }
  cout << N-p << endl;
}


Measured memory_bytes: 5120
import java.util.*;

public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	Set<String> sss = new HashSet<String>();
	String f = sc.next();
	sss.add(f);
	String s = null;
	boolean isOk = true;
	
	for(int i=0;i<N-1;i++){
	    s=sc.next();
	    sss.add(s);
	    if(f.charAt(f.length()-1) != s.charAt(0)){
		isOk = false;
		break;
	    }
	    f = s;
	}
	if(isOk==true && sss.size()==N) System.out.print("Yes");
	else System.out.print("No");
    }
}


Measured memory_bytes: 23252
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug1: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug2: "<<x<<" "<<y<<endl;
#define bug3(x, y, z) cout<<"zdongdebug3: "<<x<<" "<<y<<" "<<z<<endl;
using namespace std;
typedef long long ll;
const int maxn = 1005;
const int mod = 1000000007;


int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int a,b,d;
  cin>>a>>b>>d;
  int ret= 0;
  for(int i=a;i<=b;i++){
    if(i%d==0)ret++;
  }
  cout<<ret<<endl;
  return 0;
}

Measured memory_bytes: 3596
#coding: utf-8
S = list(input())
T = list(input())
alpha = [chr(i) for i in range(97, 97+26)]
Sl = [0 for _ in range(26)]
Tl = [0 for _ in range(26)]
for i in range(len(alpha)):
    tmp = alpha[i]
    Sl[i] = S.count(tmp)
    Tl[i] = T.count(tmp)
Sl.sort()
Tl.sort()
print("Yes" if Sl==Tl else "No")

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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------

ll H, W;

int main() {
   cin >> H >> W;
   ll ans = 1e18;

   if (H % 3 == 0 || W % 3 == 0) ans = 0;
   ll d = abs(H/3 * W - (H/3+1) * W);
   swap(H, W);
   ll e = abs(H/3 * W - (H/3+1) * W);
   swap(H, W);
   ans = min({ans, e, d});

   for (int k = 0; k < 2; k++) {
      // for (int h1 = H/2; h1 <= H/2+1; h1++) {
      for (int h1 = 1; h1 < H; h1++) {
         int h2 = H - h1;
         ll a = h1 * W;
         ll b = h2 * (W / 2);
         ll c = h2 * ((W + 1)/ 2);

         ans = min(ans, max({a, b, c}) - min({a, b, c}));
      }
      swap(H, W);
   }

   cout << ans << endl;

   return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int maxn=1005;
int X,Y,Z,K;
ll a[maxn],b[maxn],c[maxn];
priority_queue<ll> Q;
int main(){
	cin>>X>>Y>>Z>>K;
	for(int i=0;i<X;i++) cin>>a[i];
	for(int i=0;i<Y;i++) cin>>b[i];
	for(int i=0;i<Z;i++) cin>>c[i];
	sort(a,a+X,greater<ll>());
	sort(b,b+Y,greater<ll>());
	sort(c,c+Y,greater<ll>());
	for(int x=0;x<X;x++)
		for(int y=0;y<Y;y++){
			if((x+1)*(y+1)-1>=K) break;
			for(int z=0;z<Z;z++){
				if((x+1)*(y+1)*(z+1)-1>=K) break;
				ll tmp=a[x]+b[y]+c[z];
				Q.push(tmp);
			}
		}
	for(int i=0;i<K;i++){
		cout<<Q.top()<<endl;
		Q.pop();
	}
	return 0;
}


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

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int k = sc.nextInt();
		int result = 0;
		for(int i = 0; i < n; i++){
		    int x = sc.nextInt();
		    result += min(x, abs(k - x))*2;
		}
		
		// 計算
		//int result = 0;
		
		// 出力
		System.out.println(result);
	}
}


Measured memory_bytes: 23764
#include <iostream>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
int main()
{
   int a, b;
   cin >> a >> b;
   if ((a + b) % 3 == 0 || a % 3 == 0 || b % 3 == 0)
   {
      cout << "Possible" << endl;
   }
   else
   {
      cout << "Impossible" << endl;
   }
   return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define rep1(i,n) for(int i = 1; i < n; i++)
#define repv(i,n) for(int i = n-1; i >= 0; i--)
#define fi first
#define sc second
#define pb push_back
using namespace std;
typedef long long ll;

char BUF[3500000];
inline void I(int&a){scanf("%d",&a);}
inline void I(int&a,int&b){scanf("%d%d",&a,&b);}
inline void I(int&a,int&b,int&c){scanf("%d%d%d",&a,&b,&c);}
inline void I(int&a,int&b,int&c,int&d){scanf("%d%d%d%d",&a,&b,&c,&d);}
inline void L(ll&a){scanf("%lld",&a);}
inline void L(ll&a,ll&b){scanf("%lld%lld",&a,&b);}
inline void L(ll&a,ll&b,ll&c){scanf("%lld%lld%lld",&a,&b,&c);}
inline void L(ll&a,ll&b,ll&c,ll&d){scanf("%lld%lld%lld%lld",&a,&b,&c,&d);}
inline void S(string&str){str.clear();scanf("%s",BUF);int s=strlen(BUF);rep(i,s)str.pb(BUF[i]);}
inline void SV(vector<int>&v){v.clear();scanf("%s",BUF);int s=strlen(BUF);rep(i,s)if('a'<=BUF[i]&&BUF[i]<='z')v.pb(BUF[i]-'a');else v.pb(BUF[i]-'A');}

const auto EPS = 1e-10;
const auto INF = 100000000;
const auto MOD = 1000000007;
typedef pair<ll,ll> P;

ll n, k;
ll a[15];
ll ans = MOD*(ll)MOD;

int main(){
    L(n,k);
    rep(i,n) L(a[i]);
    rep(i,(1<<n)){
        if(__builtin_popcount(i) != k) continue;
        if(!(i&1)) continue;
        ll h = -1;
        ll cnt = 0;
        rep(j,n){
            if((1<<j)&i){
                if(a[j] <= h){
                    cnt += h+1-a[j]; 
                    h++;
                } else{
                    h = a[j];
                }
            } else{
                h = max(h,a[j]);
            }
        }
        ans = min(ans,cnt);
    }
    cout << ans << endl;
}
































Measured memory_bytes: 256
ai = lambda: list(map(int, input().split()))

import numpy as np
import math


def calc(A,B,C):
    a = np.linalg.norm(B - C)
    b = np.linalg.norm(C - A)
    c = np.linalg.norm(A - B)
    s = (a + b + c) / 2
    area = (s * (s - a) * (s - b) * (s - c)) ** 0.5
    r = 2 * area / (a + b + c)
    m = max(a,b,c)
    return m/(2+m/r)


a = np.array(ai())
b = np.array(ai())
c = np.array(ai())
print(calc(a,b,c))


Measured memory_bytes: 12584
/***** author :  C0d1ngPhenomena *****/

    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define endl "\n"
    #define ll long long int
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define f first
    #define s second
    #define pb push_back
    
    using namespace std;
    int main()
    {
        std::ios::sync_with_stdio(false);
        cin.tie(NULL);
       
       ll a;
       for (int i = 0; i < 5; ++i)
       {
       		cin >> a;
       		if(a==0) {
       			cout<<i+1;
       			break;
       		}
       }
        return 0;
    }


Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define nx '\n'
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define foi(i) for(auto i=v.begin();i!=v.end();i++)
#define ll long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int mpow(int base, int exp); 
void ipgraph(int n, int m);
void dfs(int u, int par);

const int mod = 1'000'000'007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int a[N];

void solve() {
  int x, n, m;
  cin>>n>>x>>m;
  cout<<m*((n+x-1)/x);
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

    // int t = 1;
    // cin >> t;
    // while(t--) {
      solve();
    // }

    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
    u--, v--;
		g[u].pb(v);
		g[v].pb(u);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}




Measured memory_bytes: 10696
import itertools

n, m, q = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(q)]

x = [i for i in range(1,m+1)]
x = itertools.combinations_with_replacement(x, n)

maxs = 0
for xi in x:
    xii = list(xi)
    
    score = 0
    for ai, bi, ci, di in a:
        if xii[bi-1] - xii[ai-1] == ci:
            score += di
    maxs = max(maxs, score)
print(maxs)

Measured memory_bytes: 9232
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
#include <iomanip>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str(); }
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,(n))
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 2;
const int MOD = 1000000007;
typedef vector<ll> vl;
typedef vector<vl> vvl;

int main() {
	int N;
	cin >> N;
	vi L(2 * N);
	REP(i, 2 * N) {
		cin >> L[i];
	}

	sort(ALL(L));
	int ans1 = 0, ans2 = 0;
	REP(i, N) {
		ans1 += L[2 * i];
	}
	REP(i, N - 1) {
		ans2 += L[2 * i + 1];
	}
	
	cout << max(ans1, ans2) << endl;
	return 0;
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<int,long double> P;
typedef pair<ll,P> PP;

//-----------------------------------------------------------------------------

int h,w;
string s[30][30],t="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

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

	cin>>h>>w;
	REP(i,h) REP(j,w) cin>>s[i][j];
	REP(i,h) {
		REP(j,w) {
			if(s[i][j]=="snuke") {
				cout<<t[j]<<i+1<<endl;
				return 0;
			}
		}
	}

	return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		long H = Long.parseLong(tokens[0]);
		int N = Integer.parseInt(tokens[1]);
		tokens = in.readLine().split(" ");
		int[] A = new int[N];
		for (int i = 0; i < N; ++i) {
			A[i] = Integer.parseInt(tokens[i]);
		}
		long sum = 0;
		for (int i = 0; i < N; ++i) {
			sum += A[i];
		}
		if (sum >= H) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

	void calc() {
	}

	void showResult() {
	}
}


Measured memory_bytes: 33748
#include <iostream>

using namespace std;

typedef long long lli;

const int N = 100000 + 10;

int dam[N];
lli mountain[N];

int main()
{
	int n, i;
	lli sum, s;
	cin>>n;
	sum = 0;
	for (i=0; i<n; i++)
	{
		cin>>dam[i];
		sum += dam[i];
	}
	s = 0;
	for (i=0; i<n-2; i+=2) s += dam[i];
	for (i=0; i<n; i+=2) 
	{
		mountain[(i+n-1)%n] = sum - s * 2;
		s = s - dam[i] + dam[(i+n-1)%n];
	}
	s = 0;
	for (i=1; i<n-1; i+=2) s += dam[i];
	for (i=1; i<n; i+=2)
	{
		mountain[(i+n-1)%n] = sum - s * 2;
		s = s - dam[i] + dam[(i+n-1)%n]; 
	}
	for (i=0; i<n-1; i++) cout<<mountain[i]<<" ";
	cout<<mountain[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 2432
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cctype>

using namespace std;

typedef long long ll;
#define rg register int

const int N = 100010;

int X, n;

struct data
{
    int b, l, r;
    friend bool operator <(const data &A, const data &B){return (ll) (X - A.b) * A.r + (ll) A.b * A.l > (ll) (X - B.b) * B.r + (ll) B.b * B.l;}
}A[N];

ll sc, L, R, s[N], val[N];

inline bool chk(ll x)
{
    int cy = x / X;
    x %= X;
    ll res = 0;
    for (rg i = 1; i <= n; i++)
    {
        ll tmp = 0;
        if(i <= cy)
        {
            tmp += s[cy + 1] - val[i];
            if(x <= A[i].b)tmp += (ll) x * A[i].l;
            else tmp += (ll) A[i].b * A[i].l + (ll) (x - A[i].b) * A[i].r; 
        }
        else
        {
            tmp += s[cy];
            if(x <= A[i].b)tmp += (ll) x * A[i].l;
            else tmp += (ll) A[i].b * A[i].l + (ll) (x - A[i].b) * A[i].r;   
        }
        res = max(res, tmp);
    }
    return res >= sc;
}

int main()
{
    scanf("%d%d", &n, &X);
    for (rg i = 1; i <= n; i++)
        scanf("%d%d%d", &A[i].b, &A[i].l, &A[i].r),
        sc += (ll) A[i].b * A[i].l, R += A[i].b;
    sort(A + 1, A + n + 1);
    for (rg i = 1; i <= n; i++)
        val[i] = (ll) (X - A[i].b) * A[i].r + (ll) A[i].b * A[i].l,
        s[i] = s[i - 1] + val[i];
    ll res = R;
    while(L <= R)
    {
        ll mid = (L + R) >> 1;
        if(chk(mid))res = mid, R = mid - 1;
        else L = mid + 1;
    }
    cout << res << endl;
}

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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left != NIL)
    x = x->left;
  
  return x;
}

Node treeMaximum(Node x){
  while(x->right != NIL)
    x = x->right;
  
  return x;
}

Node treeSearch(Node x, int k){
  if(x == NIL || k == x->key)
    return x;
  if(k < x->key)
    return treeSearch(x->left,k);
  else
    return treeSearch(x->right,k);

}

Node treeSuccessor(Node x){
  Node y;
  
  if(x->right != NIL)
    return treeMinimum(x->right);

  y = x->parent;
  
  while(y != NIL && x == y->right){
    x = y;
    y = y->parent;
  }

  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y

  if(z->left == NIL || z->right == NIL)
    y = z;
  else
    y = treeSuccessor(z);

  if(y->left != NIL)
    x = y->right;
  else
    x = y->right;

  if(x != NIL)
    x->parent = y->parent;

  if(y->parent == NIL)
    root = x;
  else if(y == y->parent->left)
    y->parent->left = x;
  else
    y->parent->right = x;

  if(y != z)
    z->key = y->key;
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  
  while(x!=NIL){
    y = x;
    if(z->key < x->key)
      x=x->left;
    else
      x=x->right;
  }
  
  z->parent = y;
  
  if(y==NIL)
    root=z;
  else
    if(z->key < y->key)
      y->left=z;
    else
      y->right=z; 
}

void inorder(Node x){
  if(x != NIL){
    inorder(x->left);
    printf(" %d",x->key);
    inorder(x->right);
  }
}
  
void preorder(Node x){
  if(x != NIL){
    printf(" %d",x->key);
    preorder(x->left);
    preorder(x->right);
  }
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}



Measured memory_bytes: 20508
#include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long

int n;
string s;

string solve(string s){
    int n = s.size();
    string ret;
    if(s[0] == 'a'){
        vector <int> as, bs;
        for(int i = 0 ; i < n ; i++){
            if(s[i] == 'a') as.push_back(i);
            else bs.push_back(i);
        }
        int lasb = -1;
        for(int i = 0 ; i < n / 2 ; i++){
            if(as[i] > lasb){
                ret += "ab";
                lasb = bs[i];
            }
        }
    }
    else{
        ret = s;
        while(s.size()){
            int x = 0;
            while(s[x] != 'a') x++;
            int y = 0;
            while(s[y] != 'b') y++;
            if(y < x) swap(x, y);
            s.erase(s.begin() + y);
            s.erase(s.begin() + x);
            ret = max(ret, s);
        }
    }
    return ret;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> s;
    vector <string> a;
    for(int i = 0 ; i < 2 * n ;){
        int cur = s[i] == 'a' ? -1 : 1;
        int j = i + 1;
        string cur_s;
        cur_s += s[i];
        while(j < 2 * n){
            cur += s[j] == 'a' ? -1 : 1;
            cur_s += s[j];
            j++;
            if(cur == 0) break;
        }
        a.push_back(cur_s);
        i = j;
    }
    for(auto &i : a) i = solve(i);
    n = a.size();
    vector <string> dp(n);
    for(int i = n - 1 ; i >= 0 ; i--){
        dp[i] = a[i];
        if(i + 1 < n){
            dp[i] = max(dp[i], dp[i + 1]);
        }
        for(int j = i + 1 ; j < n ; j++){
            dp[i] = max(dp[i], a[i] + dp[j]);
        }
    }
    cout << dp[0] << endl;
}


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

int n;

int main(void){
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    int key = 0;
    for(int i = 0; i < n; i++) key^=a[i];
    for(int i = 0; i < n; i++){
        cout << (key^a[i]) << endl;
    }
    return 0;
}


Measured memory_bytes: 3980
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>

using namespace std;
int n;
int a[100000];
int cnt[100002];
int tmp ,ans = 0;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		cnt[a[i]]++;
	}

	for (int i = 0; i < 100002; i++) {
		tmp = cnt[i] + cnt[i + 1] + cnt[i + 2];
		ans = max(ans, tmp);
	}

	cout << ans << endl;



	return(0);
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <ios>
#include <iomanip>
#include <algorithm>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)
#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)
#define REPR2(i, m, n) for (int i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a) sort(ALL(a), greater<int>())
#define REVERSE(a) reverse(ALL(a))
#define bit_search(bit, n) REP(bit, 1<<(n))
#define bit_check(bit, i) (bit>>(i)) & 1
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REP(i, a.size()) cin >> a[i];
#define INPUTP(a) REP(i, a.size()) cin >> a[i].first >> a[i].second;
#define OUTPUT_PERMUTATION(n) do{VI v(n); iota(ALL(v), 1); do{REPx(x, v) cout << x << " "; ENDL} while(next_permutation(ALL(v)));} while(0);
#define MAKE_PERMUTATION(n) do{VVI a(fact(n), VI(n)); int idx = 0; VI v(n); iota(ALL(v), 1); do{REP(i, n) a[idx][i] = v[i]; idx++; PER = a;} while(next_permutation(ALL(v)));} while(0); // int fact(), VVI PERを宣言しておく
#define ENDL cout << endl;
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using VPII = vector<PII>;
using PLL = pair<LL, LL>;
using VPLL = vector<PLL>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VC = vector<char>;
using VS = vector<string>;
using VB = vector<bool>;
using VD = vector<double>;
const int INF = 1e9;
const LL MOD = 1e9 + 7;

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

void END(){cout << 1 << endl; exit(0);}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  deque<char> dq;
  string s;
  int q;
  cin >> s >> q;
  REPx(x, s) dq.push_back(x);
  bool flg = false;
  REP(i, q)
  {
    int t;
    cin >> t;
    if (t == 1)
    {
      if (flg) flg = false;
      else flg = true;
    }
    else
    {
      int f;
      char c;
      cin >> f >> c;
      if (flg)
      {
        if (f == 1) dq.push_back(c);
        else dq.push_front(c);
      }
      else
      {
        if (f == 1) dq.push_front(c);
        else dq.push_back(c);
      }
    }
  }
  if (flg) REVERSE(dq);
  REPx(x, dq) cout << x;

  return 0;
}


Measured memory_bytes: 976
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
// memo  fixed  setprecision(20);
using vvll = vector<vector<ll>>;
ll mod =1e9+7;
/*"itob" int to "N"base */           template<typename TypeInt> string itob(const TypeInt v, int base){static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";string ret;static numeric_limits<TypeInt> t;TypeInt n = v;if (t.is_signed) {if (v < 0) n *= -1;}while (n >= base) {ret += table[n%base];n /= base;}ret += table[n];if (t.is_signed) {if (v < 0 && base == 10) ret += '-';}reverse(ret.begin(), ret.end());return ret;}
/*"chmin" a = MAX*/                  template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
/*"chmax" a = MIN*/                  template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
/*"ctoi"  char to int*/              int ctoi(char c) {return c-'0';}
/*"gcd"   MAX Euclidean */           ll gcd(ll a,ll b){if(b==0)return a; return gcd(b,a%b);}
/*"lcm"   MIN*/                      ll lcm(ll a,ll b){ll g = gcd(a,b);return a/g*b;}
/*"primecheck"If prime,return true.*/bool primecheck(ll n){if(n < 2) return false;else{for(int i = 2; i * i <= n; i++){if(n % i == 0) return false;}return true;}}
string  reverserange(string s,ll a,ll b){reverse(s.begin()+a-1,s.begin()+b); return s;}
ll modpow(ll a,ll n, ll mod){ll res = 1;while(n>0){if (n%2==1){res = res * a % mod;}a = a * a % mod;n/=2;}return res;}
int main() {
	int n,m;
  cin >> n >> m;
  vvll gura(n);
  for(int i=0;i<m;i++){
   int a,b;
    cin >>a >> b;
    a--;b--;
    gura.at(a).push_back(b);
    gura.at(b).push_back(a);
  }
  vector<ll>ans(n,1e9);
  queue<ll>que; 
  que.push(0);
  vector<bool>seen(n,false);
  vector<ll>saitan(n,1e9);
  saitan.at(0)=0;
  while(!que.empty()){
    int	now = que.front();
    que.pop();
    if(seen.at(now))continue;
    seen.at(now)=true;
    for(ll i=0;i<gura.at(now).size();i++){
     int	next = gura.at(now).at(i);
     if(seen.at(next))continue;
      if(saitan.at(next)>saitan.at(now)+1){
        saitan.at(next)=saitan.at(now)+1;
        ans.at(next)=now+1;
      }
      que.push(next);
    }
  }
  bool che = true;
  for(int i=1;i<n;i++){
    if(ans.at(i)==1e9){
      che = false;
    }
  }
  if(che){
	cout<<"Yes"<<endl;
    for(int i=1;i<n;i++){
     cout<<ans.at(i)<<endl;
    }
    return 0;
  }
  cout<<"No"<<endl;

}
    



Measured memory_bytes: 13772
import java.util.*;

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

        int[] array;
        array = new int[num];

        for(int i = 0; i < num; i++){
            array[num - 1 - i] = scanner.nextInt();
        }

        for(int i = 0; i < num - 1; i++){
            System.out.print(array[i] + " ");
        }

        System.out.println(array[num - 1]);

        scanner.close();
    }
}


Measured memory_bytes: 26508
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <cassert>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'
#define FIR first
#define SEC second
#define PB push_back
#define SZ(x) ((int)x.size())

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

template<class U, class V>
istream& operator >>(istream& in, pair<U, V>& pr) {
    return in >> pr.first >> pr.second;
}

template<class U, class V>
ostream& operator <<(ostream& out, pair<U, V>& p) {
    return out << p.first << " " << p.second;
}

template<class T>
ostream& operator <<(ostream& out, vector<T> vec) {
    for (T& e : vec)
        out << e << " ";
    return out << endl;
}

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

void solveSingleCase(int caseNo)
{
    string s;
    cin >> s;
    if (SZ(s) == SZ(set<char>(ALL(s))))
        cout << "yes";
    else
        cout << "no";
    cout << endl;
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int T = 1;
    // cin >> T;
    FOR(tcase, 1, T + 1) {
        solveSingleCase(tcase);
    }
    return 0;
};


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


int main(){
  int x, a;
  cin >> x >> a;
  if(x >= a) cout << 10 << endl;
  else cout << 0 << endl;

  return 0;

}


Measured memory_bytes: 3608
#include<stdio.h>
int main(){
   int x;
   scanf("%d",&x);
   if(x%10==2||x%10==4||x%10==5||x%10==7||x%10==9){
      printf("hon");
   }
   if(x%10==0||x%10==1||x%10==6||x%10==8){
      printf("pon");
   }
   if(x%10==3){
      printf("bon");
   }
   return 0;
}

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

vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0;
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
        res.push_back({a, ex});
    }
    if (N != 1) res.push_back({N, 1});
    return res;
}

int main() {
    long long N;
    cin >> N;
    long long ans=0;
    
    
    for (int i = 1; i < N; i++) {
        const auto &pf = prime_factorize(i);
    long long res = 1;
    for (auto p : pf) res *= p.second + 1;
		ans += res;
	}
	cout << ans << endl;
  
}

Measured memory_bytes: 3196
#!/usr/bin/env python3

def main():
    S = input()

    r = abs(753 - int(S[:3]))
    for i in range(1, len(S) - 2):
        r = min(r, abs(753 - int(S[i: i+3])))

    print(r)


if __name__ == '__main__':
    main()



Measured memory_bytes: 2940
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'0'+=16;        で大文字に
//'大文字'+=32;    で小文字に
//s[i]-'0'でchar文字→int数に;
//string s = to_string(int数);
//int n = stoi(string文字列)
//実行時間制約2秒では２×10^8回くらいまで計算できる


int main() {
  int n;
  cin >> n;
  
  vector<int> a(n);
  vector<vector<int>> b(n);
  vector<vector<int>> c(n);
  
  rep(i,n){
    cin>>a[i];
    rep(j,a[i]){
      int p,q;
      cin>>p>>q;
      b[i].pb(p);
      c[i].pb(q);
    }
  }
  
  int ans = 0;
  rep(i,(1<<n)){
    int cnt=0;
    vector<bool> p(n,false);
    rep(j,n){
      if(i & (1<<j)) {
        p[j]=true;
        cnt++;
      }
    }
    bool ho = true;
    rep(j,n){
      if(p[j]){
        rep(k,a[j]){
          if(p[b[j][k]-1]!=c[j][k]) ho = false;
        }
      }
    }
    if(ho) ans=max(ans,cnt);
  }
  
  cout << ans << endl;
  
}


Measured memory_bytes: 256
import Control.Monad
import Data.List

main = do
  n <- readLn :: IO Int
  xs <- replicateM n readLn :: IO [Int]
  let s = solve xs
  print $ if s `mod` 10 == 0 then 0 else s

solve :: [Int] -> Int
solve [] = 0
solve xs =
  let
    ts = filter (flip elem [0,10..100]) xs
    nts = filter (flip notElem [0,10..100]) xs
  in
    sum ts + trim nts
  where
    trim :: [Int] -> Int
    trim [] = 0
    trim xs
      | sum xs `mod` 10 == 0 = trim (delete (minimum xs) xs) 
      | otherwise = sum xs

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

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String[] sa = br.readLine().split(" ");
		String[] sb = br.readLine().split(" ");
		int[] a = new int[n];
		int[] b = new int[n];
		int[] d = new int[n];
		long fusoku = 0;
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sa[i]);
			b[i] = Integer.parseInt(sb[i]);
			d[i] = b[i] - a[i];
			if (d[i] > 0) {
				fusoku += d[i];
				cnt++;
			}
		}

		br.close();
		Arrays.parallelSort(d);

		boolean flg = false;
		for (int i = 0; i < n; i++) {
			if (fusoku <= 0) {
				flg = true;
				break;
			}
			if (d[i] < 0) {
				fusoku += d[i];
				cnt++;
			} else {
				break;
			}
		}

		if (flg) {
			System.out.println(cnt);
		} else {
			System.out.println(-1);
		}
	}
}


Measured memory_bytes: 58556
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define for(i, a, b) for(ll (i)=a;(i)<(b);++(i))
#define rep(i, n)    for(i, 0, n)

const ll inf = 1e15;
const ll mod = 1e9+7;

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

int main() {
    ll N, K; cin >> N >> K;
    vector<char> D(K); rep(i, K) cin >> D[i];
    
    while (true) {
        string n = to_string(N);
        ll l = n.length();
        bool ok = true;
        rep(i, l) rep(j, K) if (n[i] == D[j]) ok = false;
        if (ok) {
            cout << N << endl;
            return 0;
        }
        N++;
    }
    
    return 0
    ;
}


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

#define read(num) scanf("%d", &num)
#define readll(num) scanf("%lld", &num)
#define read2(num1, num2) scanf("%d%d", &num1, &num2)
#define read3(num1, num2, num3) scanf("%d%d%d", &num1, &num2, &num3)
#define reads(str) scanf("%s", str)
#define readc(ch) scanf("%c", &ch)

#define M 1000000007
#define pb push_back
#define mp make_pair

#define pii pair<int, int>
#define vi vector<int>
#define ll long long

#define con 998244353

int main()
{
  int n;
  cin>>n;
  double a[n];
  double sum=0;
  for(int i=0;i<n;i++){
      cin>>a[i];
  }
  sort(a,a+n);
  for(int i=0;i<n;i++){
      if(i!=n-1){
      a[i+1]=(a[i]+a[i+1])/2;
      //cout<<a[i-1]<<endl;
      }
  }
  
  cout<<fixed<<setprecision(7)<<a[n-1];
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>

using namespace std;

int main() {
   int a, b;
   cin >> a >> b;
   cout << (a + b) / 2 + (a + b) % 2 << endl;
   return 0;
}


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

int main()
{
    int n,k;
    cin >> n >> k;
    int h[n];
    for(int i=0;i<n;++i) cin >> h[i];

    int dp[n+1];
    for(int i=0;i<=n;++i) dp[i]=INF;
    dp[n]= 0;
    dp[n-1] = abs(h[n-1]-h[n-2]);
    for(int i=n-2;i>=1;--i)
    {
        for(int j=1;j<=k;++j)
        {
            if(i+j >n) continue;
            dp[i] = min(dp[i],dp[i+j] + abs(h[i+j-1]-h[i-1]));
        }
    }
    cout << dp[1] << endl;

}

Measured memory_bytes: 4344
//सत्यान्न प्रमदितव्यम्  ||
//Still, Taking my time to perfect the beats
//And I still got love for the streets, it's the A-D-D-U

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define nt _int128
#define fir first
#define sec second
#define fast_as_levi ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define debug(x) cout<<x<<"\n";
#define debugged cout<<"debugged\n";
#define inf 0x3f3f3f3f
#define LINF  0x3f3f3f3f3f3f3f3fll
#define rall(v) v.rbegin(),v.rend()
#define all(v) v.begin(),v.end() 

const ll mod = 999983;
#define mx 1000005
const ll mxi = 10005;

int main()
{
    fast_as_levi;
    ll a;
    cin>>a;
    ll p=100;
    ll ans = 0;
    while(p<a)
    {
        p += p/100;
        ans++;
    }
    cout<<ans;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#define ll long long
#define ld long double

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rrep(i, a, b) for(ll i = a; i >= b; --i)

#define pii pair<int, int>
#define pll pair<ll, ll>

#define fi first
#define se second

#define pb push_back
#define eb emplace_back

#define vi vector<int>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define all(a) a.begin(), a.end()

#define endl '\n'
using namespace std;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
  
const int MOD=1e9+7;
const ll INF=1e18;
const double PI=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
 
const int MAX=510000;
const int x = 1e9;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
   
  int n,k,s;
  cin >> n >> k >> s;
  if(s<1e9){
    rep(i,k) cout << s << " ";
    rep(i,n-k) cout << x << " ";
  }
  else{
    rep(i,k) cout << x << " ";
    rep(i,n-k) cout << 1 << " ";
  }
  return 0;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a, b;
    cin >> a >> b;
    if (a <= b){
        for (int i = 0; i < b ; i++){
            cout << a;
        }
    }
    else{
        for (int i = 0; i < a ; i++){
            cout << b;
        }
    }
}

Measured memory_bytes: 256