akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;
typedef pair<int,int> state;

int N,M;
P t[100];
int f[100][100];
int d[100][100];

void init(){
  memset(f,0,sizeof(f));
  memset(d,1,sizeof(d));
}

bool check(int from,int to){
  P base=t[to]-t[from];
  for(int i=0;i<N;i++){
    P target=t[i]-t[from];
    if(imag(target*conj(base))<0)
      return false;
  }
  return true;
}

int solve(){
  deque<state> Q;
  
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      if(f[i][j]&&check(i,j)){
        d[i][j]=0;
        Q.push_front(state(i,j));
      }
    }
  }
  
  int ans=0;
  while(!Q.empty()){
    state p=Q.front();
    Q.pop_front();
    int from=p.first;
    int to=p.second;

    
    ans=max(ans,d[from][to]);
    if(d[from][to]+1<d[to][from]){
      d[to][from]=d[from][to]+1;
      Q.push_back(state(to,from));
    }
    int id=-1;
    double mini=1e9;
    for(int i=0;i<N;i++){
      if(f[to][i]&&i!=from){
        if( arg( (t[i]-t[to])*conj(t[to]-t[from]) ) < mini){
          id=i;
          mini=arg( (t[i]-t[to])*conj(t[to]-t[from]) );
        }
      }
    }

    if(id!=-1&&d[to][id]>d[from][to]){
      d[to][id]=d[from][to];
      Q.push_front(state(to,id));
    }
  }
  return ans;
}

int main(){
  while(1){
    cin>>N>>M;
    if(N==0&&M==0)break;
    init();
    for(int i=0;i<N;i++){
      int x,y;
      cin>>x>>y;
      t[i]=P(x,y);
    }
    for(int i=0;i<M;i++){
      int x,y;
      cin>>x>>y;
      x--,y--;
      f[x][y]=f[y][x]=true;
    }
    cout<<solve()<<endl;
  }
  return 0;
}

Measured memory_bytes: 1360
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {

		String strLine ="";
		BufferedReader stdReader =
				new BufferedReader(new InputStreamReader(System.in));

		int MAX_DETASET  = 100;
		int cnt = 0;

		boolean nullflug = true;
		ArrayList<Integer> pushList = new ArrayList<Integer>();
		ArrayList<Integer> popList = new ArrayList<Integer>();

		//1. int?????????????????\???????????????????????????

		while((strLine = stdReader.readLine()) != null) {
			int temp = 0;
			//if(!strLine.equals("")){
				temp = Integer.parseInt(strLine);
		//	}
			if(temp == 0 ){
				popList.add(pushList.get(cnt-1));
				pushList.remove(cnt-1);
				cnt--;
			}else{
				pushList.add(temp);
				cnt++;
			}

		}

		//2. ??????

		for(int i = 0; i < popList.size(); i++){

			System.out.println(popList.get(i));

		}


	}


}

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

#define pb(a) push_back((a))
#define mp(a, b) make_pair((a), (b))
#define REP(a, b) for (ll i = (a); i < (b); i++)
#define REP2(a, b) for (ll j = (a); j < (b); j++)
#define REPE(a, b, c, d) \
	REP(a, b)            \
	for (ll j = (c); j < (d); j++)
#define REPV(a, b, c) for (ll(a) = b; (a) < (c); (a)++)
#define IREP(a, b) for (ll i = (a); i >= (b); i--)
#define IREP2(a, b) for (ll j = (a); j >= (b); j--)
#define IREPV(a, b, c) for (ll(a) = b; (a) >= (c); (a)--)
#define all(v) (v).begin(), (v).end()
#define Trvs(c) for (auto &it : c)
#define INF INT_MAX
#define sz(x) x.size()
#define flash                         \
	ios_base::sync_with_stdio(false); \
	cin.tie(0);                       \
	cout.tie(0);
#define F first
#define S second
#define MOD 1000000007

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;

auto cmp = [](pair<ll, pair<ll, ll>> a, pair<ll, pair<ll, ll>> b) {
	if (a.F == b.F)
		return a.S.F > b.S.F;
	return a.F > b.F;
};
//decltype(cmp)
//set<,decltype(cmp)> st(cmp);

vll prime;
void seive(ll n)
{
	vector<bool> prim(+1, 1);
	prim[0] = prim[1] = 0;
	for (ll i = 2; i * i <= n; i++)
	{
		if (prim[i])
			for (ll j = i * i; j <= n; j += i)
			{
				prim[j] = 0;
			}
	}
	REP(2, n + 1)
	{
		if (prim[i])
			prime.pb((i));
	}
}
void solve()
{
	ll n;
	cin >> n;
	vll a;
	REP(1, 1000)
	{
		a.pb(i * (i + 1) / 2);
	}
	ll ans = 0;
	for (ll i = 2; i * i <= n; i++)
	{
		ll cnt = 0;
		while (n % i == 0 and n > 1)
		{
			n /= i;
			cnt++;
		}
		if (!cnt)
			continue;
		auto loc = lower_bound(all(a), cnt);
		if ((*loc) != cnt)
		{
			loc--;
		}

		ll x = loc - a.begin() + 1;
		ans += x;
	}
	if (n > 1)
		ans++;
	cout << ans << endl;
}

int main()
{
	flash


	// seive(100001);
	// calculatepi();
	// ll t;
	// cin >> t;
	// while (t--)
	solve();
	return 0;
}


Measured memory_bytes: 3672
n = int(input())
x = n%10 
if x == 2 or x == 4 or x == 5 or x== 7 or x== 9 :
    print("hon")
elif x == 0 or x == 1 or x == 6 or x== 8 :
    print("pon")
else :
    print("bon")

Measured memory_bytes: 9172
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

h,w,a,b = inpl()
for i in range(h):
    res = []
    tmp = 0 if i < b else 1
    for j in range(w):
        if j < a:
            res.append(str(tmp))
        else:
            res.append(str(tmp^1))
    print(''.join(res))

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

int main(void){
	int n,a,b,c,x;
	int y[100];

	while(cin>>n>>a>>b>>c>>x && n){
		for(int i=0;i<n;i++){
			cin>>y[i];
		}

		int now = 0; //»ÝÌ[Ô
		int flame = 0;
		while(1){
			if(x == y[now]){
				now++;
				if(now == n) break;
			}

			x = (a * x + b) % c;
			flame++;

			if(flame > 10000){
				flame = -1;
				break;
			}
		}
		cout<<flame<<endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for(int i=(a);i<(b);i++)
#define MOD 1000000007
#define MP make_pair
#define PB push_back
typedef long long ll;

int N, x[550], num[550], ans[250250], care[250250];

int main () {
        cin >> N; fo(i, 1, N+1) cin >> x[i], care[x[i]] = i;
        fo(i, 1, N*N+1) {
                if (care[i]) {
                        ans[i] = care[i];
                        num[care[i]]++;
                        if (num[care[i]] != care[i]) {
                                puts("No");
                                return 0;
                        }
                } else {
                        int close = -1;
                        fo(j, 1, N+1) if (num[j] < j-1) {
                                if (close == -1 || x[j] < x[close]) {
                                        close = j;
                                }
                        }
                        if (close == -1) {
                                fo(j, 1, N+1) if (i > x[j] && num[j] < N) {
                                        close = j;
                                }
                        }
                        if (close == -1) {
                                puts("No");
                                return 0;
                        }
                        ans[i] = close;
                        num[close]++;
                }
        }
        puts("Yes");
        fo(i, 1, N+1) num[i] = 0;
        fo(i, 1, N*N+1) {
                num[ans[i]]++;
                if (num[ans[i]] == ans[i]) {
                        assert(i == x[ans[i]]);
                }
                printf("%d%c", ans[i], " \n"[i==N*N]);
        }
        return 0;
}


Measured memory_bytes: 2944
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
#include<set>
#include<cstdlib>
#include<cctype>
#include<ctime>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll maxn = 1e5 + 5;
const ll maxm = 1e3 + 5;
template<class T>
inline T qread(T &IEE){
	register T x = 0, f = 1;
	register char ch = getchar();
	while(!isdigit(ch)){
		if(ch == '-'){
			f = -f;
		}
		ch = getchar();
	}
	while(isdigit(ch)){
		x = (x << 1) + (x << 3) + (ch ^ 48);
		ch = getchar();
	}
	return IEE = x * f;
}
template<class T>
inline void qwrite(T a){
	if(!a){
		putchar('0');
		return ;
	}
 	if(a < 0){
		putchar('-');
		a = -a;
	}
	if(a > 9) qwrite(a / 10);
	putchar(a % 10 + 48);
	return ;
}
template<class T>
inline T ab(T a){
	return (a > 0) ? a : -a;
}
template<class T>
inline void swa(T &a, T &b){
	a ^= b ^= a ^= b;
	return ;
}
ll m, n;
string s[maxn];
const ll dar[8][2] = {{1, -1}, {1, 0}, {1, 1}, {0, -1}, {0, 1}, {-1, -1}, {-1, 0}, {-1, 1}};
bool in(ll dx, ll dy){
	return (dx >= 0 && dx < n && dy >= 0 && dy <= m);
}
int main(){
//	freopen("1.in", "r", stdin);
//	freopen("1.out", "w", stdout);
	cin >> n >> m;
	for(int i = 0;i < n;i++){
		cin >> s[i];
	} 
	for(int i = 0;i < n;i++){
		for(int j = 0;j < m;j++){
			ll cnt = 0;
			if(s[i][j] == '#'){
				cout << '#';
				continue;
			}
			for(int k = 0;k < 8;k++){
				ll tx = i + dar[k][0];
				ll ty = j + dar[k][1];
				if(in(tx, ty) && s[tx][ty] == '#'){
					cnt++;
				}
			}
			cout << cnt;
		}
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> ii;

int occ[100005];

signed main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	
	int S = 0;
	int n; cin >> n;
	for(int i = 0;i < n;i++){
		int x; cin >> x;
		occ[x] += 1;
		S += x;
	}
	
	int Q; cin >> Q;
	
	while(Q--){
		int a, b; cin >> a >> b;
		
		S -= occ[a] * a;
		S += occ[a] * b;
		
		occ[b] += occ[a];
		occ[a] = 0;
		
		cout << S << "\n";
		
	}
	
}



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

template <class Weight>
struct edge {
	int to;
	Weight cost;
	edge(int t, Weight c) : to(t), cost(c) {}
};

template <class Weight>
using edges = vector<edge<Weight>>;

template <class Weight>
using graph = vector<edges<Weight>>;

template <class T>
class radix_heap_64 {
	int bsr(unsigned long long x) {
		return x ? 63 - __builtin_clzll(x) : -1;
	}
	vector<pair<ll, T>> v[65];
	ll last;
	int sz;
public:
	radix_heap_64() : last(0), sz(0) {}
	bool empty() const {
		return !sz;
	}
	void push(ll x, T val) {
		assert(last <= x);
		++sz;
		v[bsr(x ^ last) + 1].emplace_back(x, val);
	}
	pair<ll, T> pop() {
		assert(sz);
		if (v[0].empty()) {
			int i = 1;
			while (v[i].empty()) ++i;
			pair<ll, T> new_last = *min_element(v[i].begin(), v[i].end());
			for (auto x : v[i])  v[bsr(x.first ^ new_last.first) + 1].push_back(x);
			last = new_last.first;
			v[i].clear();
		}
		--sz;
		auto res = v[0].back(); v[0].pop_back();
		return res;
	}
};

const ll INF = 1e18;

vector<ll> dijkstra(int s, const graph<ll>& G, const ll inf = INF) {
	vector<ll> dist(G.size(), inf);
	radix_heap_64<int> pq;
	pq.push(0LL, s);
	while (!pq.empty()) {
		ll d; int v;
		tie(d, v) = pq.pop();
		if (dist[v] != inf) continue;
		dist[v] = d;
		for (auto e : G[v]) if (dist[e.to] > d + e.cost) {
			pq.push(d + e.cost, e.to);
		}
	}
	return dist;
}

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int n, m, r;
	cin >> n >> m >> r;
	graph<ll> G(n);
	for (int i = 0; i < m; i++) {
		int u, v;
		ll d;
		cin >> u >> v >> d;
		G[u].emplace_back(v, d);
	}
	auto dist = dijkstra(r, G);
	for (auto d : dist) {
		if (d == INF) puts("INF");
		else printf("%d\n", (int)d);
	}
	return 0;
}



Measured memory_bytes: 22700
#include <iostream>
typedef long long int ll;
using namespace std;
#define P 998244353
#define N_MAX 300000
ll fac[N_MAX+1];
ll inv[N_MAX+1];
ll finv[N_MAX+1];

ll comb(ll n, ll k){
    return (((fac[n]*finv[n-k])%P)*finv[k])%P;
}

void init(){
    fac[0] = finv[0] = fac[1] = finv[1] = inv[1] = 1;
    for(int i = 2; i <= N_MAX; i++){
        fac[i] = (fac[i-1]*i)%P;
        inv[i] = ((-(P/i)*inv[P%i])%P+P)%P;
        finv[i] = (finv[i-1]*inv[i])%P;
    }
}

int main(){
    init();
    ll N, A, B, K, ans =0;
    std::cin >> N >> A >> B >> K;
    for(ll i=0;i<N+1;i++){
      ll j = (K - A * i)/B;
      if((K-A*i)%B == 0 && j <= N && j >= 0){
        ans = (ans + (comb(N, i) * comb(N, j))%P)%P;
      }
    }
    std::cout << ans << '\n';
}


Measured memory_bytes: 7296
#include<stdio.h>
 
int main(){
  int kazu[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int number;
  
  scanf("%d",&number);
  
  printf("%d",kazu[number-1]);
  return 0;
}

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

int main()
{
    int n, k, num[1000]={}, sum=0;
    cin>>n>>k;
    for(int i=0; i<n; ++i) {
        cin>>num[i];
    }
    sort(num, num+n);
    for(int i=0; i<k;++i) {
        sum+=num[i];
    }
    cout << sum << endl;
    return 0;
}


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

using namespace std;

int h[100002];
int dp[100002];
int n;

int solve(int i) {
	if(i == n-1) return 0;
	if(dp[i] != -1) return dp[i];

	if(i+1 < n) dp[i] = abs(h[i]-h[i+1]) + solve(i+1);
	if(i+2 < n) dp[i] = min(dp[i], abs(h[i]-h[i+2]) + solve(i+2));

	return dp[i];
}

int main() {
	scanf("%d", &n);

	for(int i=0; i<n; i++)
		scanf("%d", &h[i]);

	memset(dp, -1, sizeof(dp));

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

	return 0;
}

Measured memory_bytes: 4096
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <deque>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define x first
#define y second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define ll long long
#define ld long double
#define ii pair<int,int>
#define heap priority_queue
#define all(k) k.begin(),k.end()
#define rall(k) k.rbegin(),k.rend()
#define fa(a,c) for(auto &a:c)
#define yes "YES"
#define no "NO"



int32_t main(){
	ios::sync_with_stdio(0); cin.tie(0);
string s;
cin>>s;
char k=s[0];
if(k=='S')cout<<"Cloudy";
if(k=='C')cout<<"Rainy";
if(k=='R')cout<<"Sunny";
cout<<endl;



	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	long long n,a,b;
    cin>>n>>a>>b;
    if(n>1&&b>=a||n==1&&a==b)
        cout<<(n-2)*(b-a)+1<<endl;
    else
        cout<<0<<endl; 
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include<algorithm> 
#include <iomanip>
#include <math.h>
#include <cctype>
//小文字を大文字 c-0x20;


#define db double
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define ll long long
#define ld long double
#define maxn 5005
#define mod 998244353
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define vv(z,a,b) vector<vector<int>>z(a,vector<int>(b))
#define vvll(z,a,b) vector<vector<ll>>z(a,vector<ll>(b))
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(c) c.begin(),c.end()
#define fix(k) fixed<<setprecision(k)
#define PI 3.141592653589793
#define sizestr(i,x)  size_t i=x.length();
using namespace std;



int main(){
    int n,flag=0;
    string s;
    cin>>n>>s;
    vector<bool> first(10,false);

    for(int i=0;i<n-2;i++){
         vector<bool> second(10,false);
        int shu=s[i]-'0';
        if(first.at(shu)==false){
            first.at(shu)=true;
        }else{
            continue;
        }
        for(int j=i+1;j<n-1;j++){
             
            int seho=s[j]-'0';
             if(second.at(seho)==false){
            second.at(seho)=true;
        }else{
            continue;
        }
          string str=s;
          /*if(s.size()==1){
              flag++;
              break;
          }*/
          str.erase(0,j+1);
          sort(all(str));
           str.erase(unique(str.begin(), str.end()), str.end());
            flag+=str.size();
            //cout<<flag<<endl;

          
        }
    }
cout<<flag<<endl;

}


Measured memory_bytes: 384
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 4000000;
const int mod = 998244353;
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
   // freopen("input.txt", "r", stdin);
    int x, y, z;
    cin >> x >> y >> z;
    swap(x, y);
    swap(x, z);
    cout << x << " " << y << " " << z;
}


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

using namespace std;


void solve() {
    int n; cin >> n;
    vector<string> s(n);
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        cin >> a[i];
    }
    string t; cin >> t;
    int sum = 0;
    for (int i = n-1; i >= 0; i--) {
        if (s[i] == t) {
            cout << sum; return;
        }
        sum += a[i];
    }
}

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


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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
ll MOD = 1e9+7;
ll INF = 1e18;
void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }

ll k[7] = {7776, 6561, 1296, 729, 216, 81, 36};
ll result = INF;
//6,9,6,9,6,9,6
//元の数、添え字、合計回数
ll saiki(ll p, ll x, ll t){
  ll i;
  if(x % 2 == 1){
    for(i = 0; i < 6; i++){
      saiki(p, x - 1, t);
      p -= k[x - 1];
      t++;
    }
  }
  else if(x == 0){
    if(p <= 1000 && p >= 0){ 
      //cout << p spa x spa t << endl;
      for(i = 0; p >= 18; t += 2)
        p -= 18;
      if(p >= 15)
        t += p - 15 + 2;
      else if(p >= 12)
        t += p - 12 + 2;
      else if(p >= 9)
        t += p - 9 + 1;
      else if(p >= 6)
        t += p - 6 + 1;
      else
        t += p;
       
      chmin(result, t);  
        
    }
  }
  else
    for(i = 0; i < 9; i++){
      saiki(p, x - 1, t);
      p -= k[x - 1];
      t++;
    }
}

int main(){
  ll i, j;
  ll n;
  cin >> n;
  
  saiki(n, 7, 0);
  if(n >= 46656)
    saiki(n - 46656, 7, 1);
  if(n >= 46656 * 2)
    saiki(n - 46656 * 2, 7, 2);
  if(n >= 59049)
    saiki(n - 59049, 7, 1);
 
  cout << result << endl;

  return 0;
}

Measured memory_bytes: 256
// たなこふ先生の input マクロ (´･_･`)
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

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

    let max_len = ls.iter().max().unwrap();
    let sum_len = ls.iter().sum();

    if max_len * 2 < sum_len {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <set>
#include <deque> 
#include <string>


using namespace std;

int n;

int main()
{
	scanf("%d", &n);
	long long sum = 0;
	long long sectSum;
	long long first;
	long long last;
	long long numCounts;
	long long d = 1;
	while (d <= n) {
		first = d;
		last = n / d * d;
		numCounts = n / d;
		sectSum = (first + last) * (numCounts) / 2;
		sum = sum + sectSum;
		d++;
	}
	
	printf("%lld\n", sum);
	
	return 0;
}


Measured memory_bytes: 1724
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#include <bits/stdc++.h>
using namespace std;
const int Mod=1e9+7,N=2005,Maxn=4000000;
int n,k;
long long dp[N][N],f[Maxn+5],i_f[Maxn+5];
inline long long C(int n,int m)
{
  return (((f[m]*i_f[n])%Mod)*i_f[m-n])%Mod;
}
long long power(long long x,int P)
{
  long long ans=1,m=x;
  while(P)
  {
    if(P&1) (ans*=m)%=Mod;
    P>>=1;
    (m*=m)%=Mod;
  }
  return ans;
}
int main()
{
  scanf("%d%d",&n,&k),f[0]=1;
  if(k==1)return puts("1"),0;
  for(int i=1; i<=Maxn; ++i) f[i]=(f[i-1]*i)%Mod;
  i_f[Maxn]=power(f[Maxn],Mod-2);
  for(int i=Maxn-1; i>=0; --i) i_f[i]=(i_f[i+1]*(i+1))%Mod;
  dp[0][0]=1;
  for(int i=1; i<=n; ++i)
  {
    for(int j=0; j<=i; ++j)
    {
      dp[i][j]=dp[i-1][j];
      if(!j) continue;
      (dp[i][j]+=dp[i][j-1]*(n-j+1)%Mod*C(k-2,n-i+(n-j+1)*(k-1)-1)%Mod)%=Mod;
    }
  }
  return printf("%lld\n",dp[n][n]),0;
}

Measured memory_bytes: 94080
#include <vector>
#include <math.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <deque>
#include <cctype>
#include <unordered_map>

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<long, long>;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
#define rep(i, n) for(int i = 0; i<n; i++)
#define rep_s(i, start, n) for(int i= start;  i<n; i++)
#define rep_down(i, n) for(int i = n-1; i>=0; i--)
#define rep_down_s(i, n, start) for(int i = n-1; i>=start; i--)
#define ALL(a) (a).begin(), (a).end()
#define ALL_str(a) (a).cbegin(), (a).cend()

string alphabet_upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alphabet_lower  = "abcdefghijklmnopqrstuvwxyz";
string numbers = "0123456789";
/*
for (iterator = hash.begin(); iterator != hash.end(); iterator++)
{
// ここで、要素毎の操作を行います。
std::pair<std::string, CMyClass> element = *iterator;

}
*/
/*
using edge = struct {int to; ll cost;};
vector<edge> tree[limit];
ll depth[limit];

void dfs(int v, int p, ll d){
  depth[v] = d;
  //cout <<"v: " << v << endl;
  for (auto &e: tree[v]){
    //cout << "e.to: " << e.to << endl;
    if (e.to == p) continue;
    dfs(e.to, v, d+e.cost);
  }
}
*/
int keta_sum(int num){
  int dig, sum = 0;
  while(num){
    dig = num % 10;
    sum = sum + dig;
    num = num / 10;
  }
  return sum;
}

ll binary_search(ll left_key, ll border, ll low, ll high) {
     // 配列 a の左端と右端
    ll mid = (low+high)/2;
    while (high > low+1) {
       mid = (low+high)/2;
        if (left_key*mid>border) high = mid;
        else if (left_key*mid<border) low = mid;
        else {
          mid =mid-1;
          break;
        }
    }
    return mid;
}

bool IsPrime(ll a){
  ll b = sqrt(a);
  b++;
  while(b-->=2){
    if (a%b==0) return false;
  }
  return true;
}

ll gcd(ll a, ll b){
  ll tmp;
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }

  ll r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main(void){
  ll N, M, A, B, C, D, E, F, K,W, H, P, Q, R, X, Y;
  ll ans;
  string S, T;
  cin >> P >> Q >> R;
  ll max_pqr = min(P+Q, Q+R);
  cout << min(max_pqr, R+P) << endl;
  


}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
const int maxn=2e3+3;
const int INF=0x3f3f3f3f;
int e[maxn][maxn];
int n,x,y;
int ans[maxn];
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0' || c>'9'){
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c>='0' && c<='9'){
		x=x*10+c-'0';
		//also 
		//x=(x<<3)+(x<<1)+(c^48)
		c=getchar();
	}
	return x*f;
}
int main(){
	n=read();
	x=read();
	y=read();
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			e[i][j]=INF;
	for(int i=1;i<=n-1;i++){
		e[i][i+1]=1;
		e[i+1][i]=1;
	}
	e[x][y]=1;
	e[y][x]=1;
  for(int k = 1; k <= n; k++){
        for(int i = 1; i <= n; i++){
            if(k != i){
                int t = (k<i) ? e[i][k] : e[k][i];
                if(t == INF)  continue;
                for(int j = 1; j <= min(k,i); j++){
                    e[i][j] = min(e[i][j], t+e[k][j]);
                }
                for(int j = k+1; j <= i; j++){
                    e[i][j] = min(e[i][j], t+e[j][k]);
                }
            }
        }
    }
	for(int j=1;j<=n-1;j++)
		for(int i=j+1;i<=n;i++){
			if(e[i][j]!=INF)
				ans[e[i][j]]++;
		}

	for(int i=1;i<=n-1;i++){
		printf("%d\n",ans[i]);
	}

	return 0;
		
}

Measured memory_bytes: 16000
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, t = sc.nextInt()
  val a = Array.fill(n)(sc.nextInt())
  val b = a.scanLeft(Int.MaxValue)((x, y) => x.min(y)).tail
  val c = a.zip(b).map{case (v, min) => v - min}
  val max = c.max
  println(c.count(_ == max))
}


Measured memory_bytes: 65600
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Main main=new Main();
		main.run();
	}

	void run() {

		Scanner sc=new Scanner(System.in);

		String input =sc.next();

		int gyoukan=input.length()-1;

		//三つの隙間に＋か－を入れて、7になる式をつくる。
		//bit列をつくって0を－、1を＋に対応させる。

		for(int bitretu=0;bitretu<(1<<gyoukan);bitretu++) {


			int sum=0;

			//今右から何桁目を指しているかを管理するための変数。
			for(int pointer=0;pointer<gyoukan;pointer++) {

				int a=input.charAt(gyoukan-pointer)-'0';

				if((bitretu>>pointer)%2==0) {
					sum-=a;
				}else {
					sum+=a;
				}

			}

			//一番左は毎回足し算する。
			sum+=(input.charAt(0)-'0');


			//1234
			//gyoukan=3;
			if(sum==7) {
				String result="";

				for(int pointer=0;pointer<gyoukan;pointer++) {

					result=input.substring(input.length()-1-pointer,input.length()-pointer)+result;

					if((bitretu>>pointer)%2==0) {
						result="-"+result;
					}else {
						result="+"+result;
					}

				}

				result=input.substring(0,1)+result+"=7";

				System.out.println(result);
				break;

			}

		}

	}






}





Measured memory_bytes: 23380
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define P pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define MOD 1000000007
int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
int kaijo(int n){
	int ans=1;
	for(int i=2;i<=n;i++){
		ans*=i;
		ans%=MOD;
	}
	return ans;
}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
signed main(){
	int n,k;
	cin>>n>>k;
	if(2*k-1<=n)puts("YES");
	else puts("NO");
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <tuple>
#include <stack>
#include <bitset>
#include <utility>
#include<iomanip>
// #include <numeric>
using namespace std;



typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector<vector<ll>> vvint;
typedef vector<string> vstring;
typedef vector<vector<string>> vvstring;
typedef vector<char> vchar;
typedef vector<vector<char>> vvchar;
typedef vector<long double> vdouble;
typedef vector<vector<long double>> vvdouble;
typedef vector<vector<vector<long double>>> vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define INT_MAX 2147483647
#define LLONG_MAX 9223372036854775807
#define vmax(vec) *max_element(vec.begin(), vec.end())
#define vmin(vec) *min_element(vec.begin(), vec.end())
#define vsort(vec) sort(vec.begin(), vec.end())
#define vsortgr(vec) sort(vec.begin(), vec.end(), greater<ll>())
#define DIVIDER 1000000007


//
// struct Node{
//   vint children;
//   ll index;
//   ll prop;
// };
// struct edge{ll to; ll cost;};



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

// ll X,Y,Z,K;
// ll pmax = 30000000000;
// vint A,B,C;




// struct UnionFind {
//     vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
//
//     UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
//         for(int i = 0; i < N; i++) par[i] = i;
//     }
//
//     int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
//         if (par[x] == x) return x;
//         return par[x] = root(par[x]);
//     }
//
//     void unite(int x, int y) { // xとyの木を併合
//         int rx = root(x); //xの根をrx
//         int ry = root(y); //yの根をry
//         if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
//         par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
//     }
//
//     bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
//         int rx = root(x);
//         int ry = root(y);
//         return rx == ry;
//     }
// };
//
// vint divisor(ll n){ // nの約数
//   vint ret;
//   for(ll i=1;i*i<=n;i++){
//     if(n%i == 0){
//       ret.pb(i);
//       if(i*i!=n) ret.pb(n/i);
//     }
//   }
//   vsort(ret);
//   return ret;
// }
//
// ll get_digits_num(ll n){
//   ll ret=0;
//   while(n){
//     n/=10;
//     ret++;
//   }
//   return ret;
// }


ll f(ll n){
  ll rtn;
  ll m = n%8;

  rtn = 0;
  for(ll i=n-m;i<=n;i++){
    rtn = rtn^i;
  }

  return rtn;
}


int main() {
  cout<<fixed<<setprecision(10);

  ll P,Q,R;
  cin>>P>>Q>>R;

  ll a = P+Q;
  ll b = P+R;
  ll c = Q+R;

  cout << min(min(a,b), c) << endl;


}




//


Measured memory_bytes: 256
//Totka hai dosto
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
const int mod=998244353;
const int N=2e5+9;
int f1[N];
int f2[N];
ll modp(ll a, ll b)
{
	if(b==0)return 1;
	ll u=modp(a,b/2);
	u=(u*u)%mod;
	if(b&1)
	return (a*u)%mod;
	return u;
}
int ncr(int n, int r)
{
	if(n<r)return 0;
	int res=(f1[n]*f2[n-r])%mod;
	res=(f2[r]*res)%mod;
	return res;
}
int32_t main()
{
	f1[0]=1;f2[0]=modp(f1[0],mod-2);
	for(int i=1;i<=200000;i++)
	{
		f1[i]=(f1[i-1]*i)%mod;
		f2[i]=modp(f1[i],mod-2);
	}
	
	int ans=0,tmp=0;
	
	int n,m,k;
	cin>>n>>m>>k;
	
	for(int i=0;i<=k;i++)
	{
		tmp=0;
		tmp=ncr(n-1,i)*m;
		tmp%=mod;
		tmp=(tmp*modp(m-1, n-1-i));
		tmp%=mod;
		ans+=tmp;ans%=mod;
	}
	
	cout<<ans;
	
}

Measured memory_bytes: 6764
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include<set>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/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;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
llfor;///////////////////////////////////////////////////////////
int main(){
 char o[60],e[60];
 sc(o);sc(e);
 rep(i,0,strlen(o)){
  if(strlen(o)-strlen(e)==1&&i==strlen(o)-1)cout<<o[i];
  else cout<<o[i]<<e[i];
 }
 pnn;
return 0;}

Measured memory_bytes: 3564
#include<bits/stdc++.h>
#include<cmath>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) cout << (x) << endl;
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};



int main(void){
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    ll x;
    cin >> x;
    ll tmp = 0;
    if(x < 100){
      print(0);
      return 0;
    }
    if(x == 100){
      print(1);
      return 0;
    }
    if(x == 101){
      print(1);
      return 0;
    }
    if(x == 102){
      print(1);
      return 0;
    }
    if(x == 103){
      print(1);
      return 0;
    }
    if(x == 104){
      print(1);
      return 0;
    }
    rep(i,100000){
      tmp += 100;
      if(tmp == x){
        print(1);
        return 0;
      }else if(tmp > x){
        while(tmp > 0){
          tmp -= 100;
          if( (x - tmp) % 100  == 0 || (x - tmp) % 101  == 0 || (x - tmp) % 102  == 0 || (x - tmp) % 103  == 0 || (x - tmp) % 104  == 0 || (x - tmp) % 105  == 0){
            print(1);
            return 0;
          }
        }
        print(0);
        return 0;
      }
    }

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define MAX 5000
#define MOD 1000000007


int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a.at(i);
  }
  sort(a.begin(),a.end());

  int k=lower_bound(a.begin(),a.end(),(a.at(n-1)-1)/2+1)-a.begin();
  if(k==n-1){
    k--;
  }
  if(k>0){
    if(2*a.at(k)-a.at(n-1)>a.at(n-1)-2*a.at(k-1)){
      k--;
    }
  }
  cout<<a.at(n-1)<<" "<<a.at(k)<<endl;
}


Measured memory_bytes: 640
import java.io.*;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
//        int t = in.nextInt();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            int a = in.nextInt();
            int b = in.nextInt();
            for (int i = 1; i <= 1009; i++) {
                if ((int)(i * 0.08) == a && (int)(i * 0.1) == b){
                    out.println(i);
                    return;
                }
            }
            out.println(-1);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextLine() throws IOException {
            return reader.readLine().trim();
        }
    }
}


Measured memory_bytes: 21460
open Printf
open Scanf

let solve n =
  let sum_mult x y =
    let i = x / y in
    i * (i + 1) / 2 * y in
  sum_mult n 1 + sum_mult n 15 - sum_mult n 3 - sum_mult n 5

let () =
  scanf "%d " solve |> printf "%d\n"


Measured memory_bytes: 3816
import java.util.Scanner;

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for (int i = 0; i < n; i++) {
			int[] ball = new int[10];
			for (int j = 0; j < 10; j++)
				ball[j] = scan.nextInt();
			int l = 0;
			int r = 0;
			boolean impossible = false;
			for (int j = 0; j < 10; j++) {
				if (l < ball[j]) {
					l = ball[j];
				} else if (r < ball[j]) {
					r = ball[j];
				} else {
					impossible = true;
				}
			}
			System.out.println(impossible? "NO":"YES");
		}
	}
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 26064
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <string>

using namespace std;

int main () {
  string s;
  cin >> s;
  
  int slen = (int)s.length();
  
  long sum = 0;
  for (int bit = 0; bit < (1<<(slen-1)); bit++) {
    int cur = 0;
    for (int i = 0; i < slen; i++) {
      if (bit & (1<<i)) {
        long num = 0;
        sscanf(s.substr(cur, i-cur+1).c_str(), "%ld", &num);
        sum += num;
        cur = i + 1;
      }
    }
    long num = 0;
    sscanf(s.substr(cur, slen-cur).c_str(), "%ld", &num);
    sum += num;
  }
  
  cout << sum << "\n";
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1;} return 0;}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////


int main() {
    int n; cin >> n;
    auto rec = [&](auto &&rec, int b, string s) -> void {
        if (s.size() == n) {
            cout << s << endl;
            return;
        }

        rep(i,b+1) {
            string t = s;
            t += 'a'+i;
            if (i == b) rec(rec, b+1, t);
            else rec(rec, b, t);
        }
    };
    rec(rec, 1, "a");
    return 0;
}

Measured memory_bytes: 1536
#include <iostream>
#include <sstream>
#include <algorithm>
#include <functional>
#include <iterator>
#include <numeric>
#include <cstdint>
#include <cmath>
#include <bitset>
#include <string>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>

#define N_TIMES(i, n)     for ( uint64_t i = 0;     i <  n; ++i )
#define N_TIMES_REV(i, n) for (  int64_t i = n - 1; i >= 0; --i )

using namespace std;

const uint64_t MOD = 1e+9 + 7;

/*
 *  A | B || A + B | A ^ B |
 *    |   || S | C | S | C | >
 * ---+---++---+---+---+---+---
 *  0 | 0 || 0 | 0 | 0 | 0 | F
 *  0 | 1 || 1 | 0 | 1 | 0 | F
 *  1 | 0 || 1 | 0 | 1 | 0 | F
 *  1 | 1 || 0 | 1 | 0 | 0 | T
 *
 * A + B >= A ^ B
 * A + B > A ^ B iff A = 1 and B = 1
 */

int main()
{
  string L;
  cin >> L;
  
  uint64_t N = L.size();

  vector<uint64_t> dp1(N + 1, 0), dp2(N + 1, 0);
  dp2[0] = 1;

  N_TIMES(n, N) {
    uint64_t x = L[n] - '0';

    dp1[n + 1] = (3 * dp1[n]) % MOD;
    if (x == 1) {
      dp2[n + 1] = (2 * dp2[n]) % MOD;
      dp1[n + 1] = (dp1[n + 1] + dp2[n]) % MOD;
    } else {
      dp2[n + 1] = dp2[n];
    }
  }

  uint64_t ans = (dp1[N] + dp2[N]) % MOD;
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 2048
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

int main()
{
	long long int n, a, b, c, d;
	cin >> n >> a >> b >> c >> d;
	if(a > b) swap(a, b);
	for(long long int i = 0 ; i < n; i++){
		long long int l = a - i * d;
		long long int r = a - i * c;
		l += c * (n - 1 - i);
		r += d * (n - 1 - i);
		if(l <= b && b <= r){
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
	return 0;
	return 0;
}

Measured memory_bytes: 256
import java.io.*;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str;
while((str=br.readLine())!=null){
char[] ch=str.toCharArray();
for(int i=0;i<ch.length;i++){
if(ch[i]>='a'&&ch[i]<='z'){
ch[i]-=32;
}
}
System.out.println(ch);
}
}
}

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

int main(){
    int n, m, k;
    cin >> n >> m >> k;
    int f = 0;
    for(int i = 0; i <= n; i++){
        for(int j = 0; j <= m; j++){
            int tmp = i * (m - j) + (n - i) * j;
            if(tmp == k) f = 1;
        }
    }
    cout << (f ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 100000000
#define INF 300000000000000000
#define MOD 1000000007
#define mod 1000000007
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define rep(i,n)for (ll i = 0; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp1(pair<ll,ll>a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi<b.fi;
}
//----------------------------------------------------------------------

//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_time=clock();
    //-------------------------------
    int r;cin>>r;
    //cout<<(double)r*2.0*PI<<endl;
    printf("%.10lf\n",(double)r*2.0*PI);
    //-------------------------------  
    //ll end_time=clock();cout<<"time="<<end_time-begin_time<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------

















































Measured memory_bytes: 3784