akhauriyash/Code-Regression huggingface dataset:
#[macro_use]
mod input {

use std;
use std::io;

const SPLIT_DELIMITER: char = ' ';

#[macro_export]
#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

#[allow(dead_code)]
pub fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
pub fn p<T>(t: T)
where
    T: std::fmt::Display,
{
    println!("{}", t);
}

#[allow(dead_code)]
pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let vec_line = input_vector();
        v.push(vec_line);
    }
    v
}

#[allow(dead_code)]
pub fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

#[allow(dead_code)]
pub fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}
}

use input::*;
use std::collections::BinaryHeap;

fn main() {
    let n: usize;
    input!(n);
    let mut v = input_vector::<isize>();
    let mut heap = BinaryHeap::new();
    for z in v {
        heap.push(-1 * z * 1_000_000);
    }

    while heap.len() != 1 {
        let a = -1 * heap.pop().unwrap();
        let b = -1 * heap.pop().unwrap();
        heap.push(-1 * ( a + b) / 2);
    }
    p(heap.pop().unwrap() as f64 / 1_000_000.0 * -1.0);
}

Measured memory_bytes: 4352
N, W = map(int, input().split())
dp = [[float("inf")] * (10**5 + 1) for i in range(N+1)]
dp[0][0] = 0

for i in range(N):
  w, v = map(int, input().split())
  for j in range(10**5 + 1):
    dp[i+1][j] = min(dp[i][j], dp[i][j-v] + w) if j >= v and dp[i][j-v] + w <= W else dp[i][j]

ans = 0
for i in range(10**5 + 1):
  if dp[-1][i] <= W:
    ans = i
print(ans)

Measured memory_bytes: 187704
#include <stdio.h>

int main(void) {
	int a,b,c;
	int cnt = 0;
	scanf("%d%d%d",&a,&b,&c);
	for(int i = a; i <= b; i++){
		if(!(c%i))cnt++;
	}
	printf("%d\n",cnt);
	return 0;
}



Measured memory_bytes: 2104
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <random>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
struct FIO{FIO(){std::cin.tie(0);std::cout.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::setprecision(15);}}fIO;
template<typename T> using V = std::vector<T>;
template<typename T> void fill(V<T>&v) { for(T&e:v) std::cin >> e; }
/*-*/

int main() {
	int n;
	std::cin >> n;
	V<lnt> a(n);
	fill(a);
	lnt max=0;
	lnt sum=0;
	rep(i,n) {
		max=std::max(max,a[i]);
		sum+=max-a[i];
	}
	print(sum);
}


Measured memory_bytes: 4780
package main

import "fmt"

func max(num []int)int{
  max:=0
  for i:=0;i<len(num);i++{
    if max<num[i]{
      max=num[i]
    }
  }
  return max
}
func main(){
  var n int
  fmt.Scan(&n)
  
  var p = make([]int,n)
  ans := 0
  for i:=0;i<n;i++{
    fmt.Scan(&p[i])
    ans += p[i]
  }
  
  max := max(p)
  ans -= max/2
  fmt.Println(ans)
}
  
  

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

#define rep(i, n)  for (int i = 0; i < (int) (n); i++)
#define Rrep(i, n) for (int i = ((int) n - 1); i >= 0; i--)
#define all(x)     (x).begin(), (x).end()
#define SZ(x)      ((int) (x).size())
#define INF 2e15
#define MOD 10e9 + 7

typedef vector <int> vint;
typedef long long    ll;

vector <int> prod = { 100, 101, 102, 103, 104, 105 };
int          x;
bool         fg = false;
vector <int> checked(0, -1);

int buy(int sum);

int main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    cin >> x;


    rep(i, x) {
        if (100 * i <= x && 105 * i >= x) { fg = true; break; }
    }
    cout << fg << endl;
}


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

using namespace std;

int main() {
	
	string A;
	
	while( cin >> A) {
	
	int sum = 0;
	
	if( A == "0")
	break;
	
	for(int i=0;i<A.length();i++) {
		
		sum += A[i] - 48;
		
	}
	
	cout << sum << "\n";
}
	return 0;
}


Measured memory_bytes: 3208
/*
auth - @sportykush
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
 
using namespace __gnu_pbds;
using namespace std;
 
typedef long long int ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; 
 
//#define mp make_pair
#define bug(v)                    cerr<<#v<<" = "<<(v)<<endl;
#define ERASE(x)                  x.erase(unique(x.begin(),x.end()),x.end())
#define pb                        emplace_back
#define vii                       vector<int>
#define vll                       vector<ll>
#define vpll                      vector< pair <ll,ll> >
#define pll                       pair <ll,ll>
#define pii                       pair <int,int>
#define pq                        priority_queue< int >
#define khtm                      "\n"
#define F                         first
#define S                         second
#define fr(i,a,n)                 for(i=a;i<n;i++)
#define mem(arr,l)                memset(arr,l,sizeof arr)
#define ALL(x)                    x.begin(), x.end()
#define frr(i,a,n)                for(i=n-1;i>=a;i--)
#define fast                      ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define testcase                  ll T; cin>>T; while(T--)


const int MAX = 1e6 +2;
const ll inf =  1e18;
const int N = 1010;
//const ll mod = 998244353 ;
const ll mod=1e9+7;
inline ll add(ll a,ll b){a+=b;if(a>=mod)a-=mod;return a;}
inline ll mul(ll a,ll b){return ((a%mod)*1ll*b)%mod;}
inline ll power(ll a,ll b){ll rt=1;while(b>0){if(b&1)rt=mul(rt,a);a=mul(a,a);b>>=1;}return rt;}


/*
important builtin functions
__gcd(value1, value2)
__builtin_ffs(x)
  Number of leading zeroes: __builtin_clz(x)
  Number of trailing zeroes : __builtin_ctz(x)
  Number of set bits: __builtin_popcount(x)
*/
 

ll i,j,k,l,m,r,n;
//ll a[MAX],b[MAX];

int main()
{
 
  #ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
//cout << setprecision(15) << fixed;
fast

ll a,b,c;
cin >> a >> b >> c >> k;

ll ans = a;
if(k>a+b)
{
	cout << ans - (k-(a+b));
}
else
	cout << min(k,ans);


  #ifndef ONLINE_JUDGE
  cout<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s";
  #endif
 
  return 0;
 
}

Measured memory_bytes: 3640
N = gets.to_i

ab = []
limit = 0
tasks = 0
N.times do
  a, b = gets.split.map(&:to_i)
  tasks += a
  limit = b if limit < b
  ab << [a, b]
end

if tasks > limit
  puts 'No'
  exit
end

ab.sort_by! { |e| [e[1], e[0]] }

task = 0
ab.each do |e|
  task += e[0]
  if task > e[1]
    puts 'No'
    exit
  end
end

puts 'Yes'

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



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

            String s;
            int a , b;
            while((s = br.readLine())!=null)
            {
            	StringTokenizer st = new StringTokenizer(s," ");
            	a = Integer.parseInt(st.nextToken());
            	b = Integer.parseInt(st.nextToken());     
            	if(a==0 && b==0)
            	{
            		System.exit(0);
            	}
            	System.out.println(calDay(a,b));
            }
            
    	}catch (Exception e) {
            e.printStackTrace();
        }
       
    }
    
    private static String calDay(int month,int date) {
    	
    	int year = 2004;
    	int h = 0;
    	
    	
    	ArrayList<String> dayList = new ArrayList<String>();
    	dayList.add("Saturday");
    	dayList.add("Sunday");
    	dayList.add("Monday");
    	dayList.add("Tuesday");
    	dayList.add("Wednesday");
    	dayList.add("Thursday");
    	dayList.add("Friday");
    	
    	if(month ==1 || month==2)
    	{
    		month += 12;
    		year = year - 1;
    	}
    	
    	int C = (int)Math.floor(year/100);
    	int Y = year%100;
    	
    	h = (5*C + Y + (int)Math.floor(Y/4) + (int)Math.floor(C/4) + (int)Math.floor(26*(month+1)/10) + date) % 7;
    	
    	return dayList.get(h);
    }

}

Measured memory_bytes: 24176
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
#define N 500050
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<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*f;
}
int n,ans[N];
char s[N];
ll tot;
int main(){
	scanf("%s",s+1);
	n=strlen(s+1)+1;
	s[0]='>',s[n]='<';
	for(int i=1;i<=n;++i){
		if(s[i-1]=='>'&&s[i]=='<'){
			ans[i]=0;
			for(int j=i-1;j>=1;--j){
				if(s[j]^'>')break;
				ans[j]=max(ans[j],ans[j+1]+1);
			}
			for(int j=i+1;j<=n;++j){
				if(s[j-1]^'<')break;
				ans[j]=max(ans[j],ans[j-1]+1);
			}
		}	
	}
	for(int i=1;i<=n;++i){
		tot+=ans[i];
	}
	printf("%lld\n",tot);
	return 0;
}



Measured memory_bytes: 6184
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

x,y,z,k = inpl()
a = inpl()
b = inpl()
c = inpl()
ab = []
for i in a:
    for j in b:
        ab.append(i+j)
ab.sort(reverse=True)
abc = []
for i in range(min(k, len(ab))):
    for j in range(z):
        abc.append(ab[i] + c[j])
abc.sort(reverse=True)
for i in range(k):
    print(abc[i])
 



Measured memory_bytes: 152796
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <fstream>

#include <string>
#include <vector>
#include <math.h>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <bitset>
using namespace std;
using ll = long long;
constexpr ll INF = 1010000000000000017LL;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()

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

ll LCM(ll a, ll b) {
    return a/GCD(a,b)*b;
}

class CMonstersBattleRoyale {
public:
	void solve(std::istream& in, std::ostream& out) {
        ll n;
        in>>n;
        vector<ll> a(n);
        rep(i,n) in>>a[i];

        ll res=0;
        rep(i,n){
            res=GCD(res,a[i]);
        }
        out<<res<<endl;
	}
};


int main() {
	CMonstersBattleRoyale solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

using namespace std;
const long long mod = 1e9 + 7;
int main() {
    cin.tie(0); ios_base::sync_with_stdio(0); //Don't ever delete this line


    int n;
    cin >> n;
    vector <int> v(n);
    for(int i=0;i<n;i++){
        cin >> v[i];
    }
    sort(v.begin(),v.end());
    if(n%2==0){
        bool notzero=true;
        for(int i=1;i<=n/2;i++){
            if(v[2*(i-1)]!=(2*(i-1)+1)||v[2*(i-1)+1]!=(2*(i-1)+1)){
                notzero=false;
            }
        }
        if(notzero==false){cout<<0<<"\n";}
        else{
            long long ans = 1;
            for (int i = 0; i < n/2; i++) {
                    ans = (ans * 2) % mod;
                }
            cout << ans << "\n";
        }
    }
    else{
        bool notzero=true;
        if(v[0]!=0)notzero=false;
        for(int i=1;i<=n/2;i++){
            if(v[2*(i)]!=(2*i)||v[2*(i)-1]!=(2*i)){
                notzero=false;
            }
        }
        if(notzero==false){cout<<0<<"\n";}
        else{
            long long ans = 1;
            for (int i = 0; i < n/2; i++) {
                    ans = (ans * 2) % mod;
                }
            cout << ans << "\n";
        }
    }

	return 0;

}












Measured memory_bytes: 3728
#include <bits/stdc++.h>
 
#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif // LOCAL_
#define dumpl(x1) fprintf(stderr, "#%s.%d (%s) = (%ld)\n", __func__, __LINE__, #x1, x1);
#define dumpll(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%ld, %ld)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define dumplll(x1, x2, x3) fprintf(stderr, "#%s.%d (%s, %s, %s) = (%ld, %ld, %ld)\n", __func__, __LINE__, #x1, #x2, #x3, x1, x2, x3);
#define dumpd(x1) fprintf(stderr, "#%s.%d (%s) = (%lf)\n", __func__, __LINE__, #x1, x1);
#define dumpdd(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%lf, %lf)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define loop for(;;)
 
struct S002 {
  int n;
  S002& operator > (long& x) {
    n = x;
    return *this;
  }
  S002& operator > (long&& x) {
    n = x;
    return *this;
  }
  S002& operator >= (long& x) {
    if( scanf("%ld", &x) <= 0 ) exit(0);
    return *this;
  }
  S002& operator >= (double& x) {
    if( scanf("%lf", &x) <= 0 ) exit(0);
    return *this;
  }
  S002& operator >= (std::string& s) {
    if( not (std::cin >> s) ) exit(0);
    return *this;
  }
  template<typename a>
  S002& operator >= (std::vector<a>& v) {
    v.resize(n);
    for(long i = 0; i < n; ++i) {
      *this >= v[i];
    }
    return *this;
  }
  template<typename a, std::size_t s>
  S002& operator >= (std::array<a, s>& x) {
    for(long i = 0; i < (long)s; ++i) {
      *this >= x[i];
    }
    return *this;
  }
};

struct Solver {
  std::string str;
  Solver() {
    S002 reader;
    reader >= str;
  }
  void solve() {
    long s = 0;
    for(char c : str) {
      if( s == 0 and c == 'C' ) s = 1;
      if( s == 1 and c == 'F' ) s = 2;
    }
    puts(s == 2 ? "Yes" : "No");
  }
};

int main() {
  loop std::unique_ptr<Solver>(new Solver())->solve();
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	vector<pll> v(n);
	rep(i,n)cin>>v[i].sc>>v[i].fs;
	sort(all(v));
	bool ans=true;
	ll cur=0;
	rep(i,n){
		cur+=v[i].sc;
		if(cur>v[i].fs)ans=false;
	}
	Yn(ans);
}


Measured memory_bytes: 3328
import numpy as np

N , D = map(int , input() . split() )
X = np.array( [ list( map( int , input() . split() ) ) for i in range( N ) ] )

count = 0

for i in range( N-1 ):
    for j in range( i+1 , N ):
        distance = ( np.sum( ( X[i] - X[j] ) ** 2 ) ) ** ( 1/2 )
        if int(distance) == distance:
            count += 1
print(count)

Measured memory_bytes: 14344
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder2 {
	class Program {
		static void Main(string[] args) {

			var inputArray = retreiveLongArray();
			var inputCount = 1;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			long X = inputArray[0];

			long count = 0;
			double money = 100;

			while (money < X) {
				count++;
				var hukuri = money * 1.01;
				money = Math.Floor(hukuri);
			}

			//答えの出力
			var ans = count;
			Console.WriteLine(ans);

		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray = Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static long[] retreiveLongArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var longArray = inputArray.Select(s => long.Parse(s));
			return longArray.ToArray();
		}
	}
}


Measured memory_bytes: 28236
function main(input) {
  input = input.split('\n');
  var a = input[0].split(' ')[0];
  var b = input[0].split(' ')[1];
  var s = input[1].split('-');
  var s1 = input[1].split('-')[0];
  var s2 = input[1].split('-')[1];
  if (s.length === 2 && s1.length == a) {
    console.log('Yes')
  } else {
    console.log('No')
  }
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
#define MAXN 2010
#define pii pair<int,int>
#define ff first
#define ss second
#define ll long long
#define in_range(x, y, n) (x >= 0 and x<n and y >=0 and y<n)
using namespace std;
const ll mod = 1e9 + 7;

ll n, m, ps[MAXN][MAXN];

int main (){
    ios_base::sync_with_stdio(false);

    cin >> n >> m;

    vector<ll> a(n), b(m);

    ps[n][0] = ps[0][m] = 1;

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

    for (int i=0; i<m; i++){
        ps[0][i] = 1;
        cin >> b[i];
    }

    for (int i=1; i<=n; i++){
        for (int j=1; j<=m; j++){
            ps[i][j] = (ps[i-1][j] + ps[i][j-1])%mod;
            if (a[i-1] != b[j-1]){
                ps[i][j] = (ps[i][j] - ps[i-1][j-1] + mod)%mod;
            }
        }
    }

    cout << ps[n][m] << endl;
    return 0;
}

Measured memory_bytes: 31744
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <numeric>

using namespace std;

int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if(c!=min({a,b,c}) && c!=max({a,b,c}))cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

   


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cctype>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <cstdio>
#include <numeric>
#include <functional>
#include <cstdlib>
#include <regex>
#include <list>
int main() {
	std::string a;
	std::cin >> a;
	int c = a.size();
	std::vector<int> num(c);
	int A = c - 2;
	std::vector <int> V(A);
	int sum;
	int ans;
	for (int i = 0;i < c;++i) {
		num[i] = a[i] - '0';
	}
	for (int i = 0;i < A;++i) {
		sum = 100 * num[i] + 10 * num[i + 1] + num[i + 2];
		if (sum <= 753) {
			V[i] = 753 - sum;
		}
		else {
			V[i] = sum - 753;
		}
	}
	ans = *std::min_element(V.begin(), V.end());
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int n,a[110],min=1100,max=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        if(min>a[i])min=a[i];
        if(max<a[i])max=a[i];
    }
    printf("%d\n",max-min);
    return 0;
}


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

typedef long long ll;

const ll N=1002, mod=1e9+7;
ll n, m, dp[N][N];
string s[N];
bool vis[N][N];

ll solve (ll x, ll y)
{
    if(vis[x][y]) return dp[x][y];
    vis[x][y]=1;
    ll cnt=0;
    if(x==n-1 && y==m-1) return dp[x][y]=1;
    if(x<(n-1) && s[x+1][y]=='.') cnt+=solve(x+1,y);
    cnt%=mod;
    if(y<(m-1) && s[x][y+1]=='.') cnt+=solve(x,y+1);
    dp[x][y]=cnt%mod;
//    cout<<"HI "<<x<<" "<<y<<" "<<s[x][y]<<" "<<dp[x][y]<<"\n";
    return dp[x][y];
}


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

   cin>>n>>m;
   for(ll i=0; i<n; i++) cin>>s[i];
   cout<<(ll)solve(0,0);


}


Measured memory_bytes: 10240
#include <stdio.h>

int main(void)
{
	int i;
	int j;
	
	for (i = 1; i <= 9; i++) {
		for (j = 1; j <= 9; j++) {
			printf("%dx%d=%d\n", i, j, j * i);
		}
	}
	
	return (0);
}

Measured memory_bytes: 524
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long X = sc.nextLong();
		long T = sc.nextLong();
		long ans = N/X;
		if(N%X>0){
		    ans++;
		}
		System.out.println(ans*T);
	}
}


Measured memory_bytes: 35708
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int  ,int > pii;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const ll maxn  = 3e6;
const ll mod =1e9+7;
const ld PI = acos((ld)-1);
 
#define pb(x) push_back(x);
#define endl '\n'
#define dokme(x) cout << x ;  return(0);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ms(x , y) memset(x , y , sizeof x);
#define file_init freopen("input.txt", "r+", stdin); freopen("output.txt", "w+", stdout);
ll pw(ll a, ll b, ll md = mod){ll res = 1;while(b){if(b&1){res=(a*res)%md;}a=(a*a)%md;b>>=1;}return(res);}
 
 
 
int main(){
    migmig
  	int n;
  cin >> n;
  ll ans = 0;
  for(ll i = 1 ; i <= n ; i ++){
    if(i%3 and i%5){
      ans+=i;
    }
  }
  cout << ans;
 
    return(0);
}

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

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define rep(i, k, n) for (int i = (int)(k); i < (int)(n); ++i)
#define rrep(i, k, n) for (int i = (int)(n) - 1; i >= (int)(k); --i)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vv_ii;
typedef pair<int,ii> i_ii;
typedef vector<i_ii> vi_ii;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;

template <class T>
inline ostream& operator<<(ostream & o, vector<T> const& v) {
    for (int i = 0; i < (int)(v.size()) - 1; ++i)
        o << v[i] << ' ';
    if (!v.empty())
        o << v.back();
    return o;
}

template <class T, class Q>
inline ostream& operator<<(ostream & o, pair<T,Q> const& p) {
    o << "(" << p.fi << "," << p.se << ")";
    return o;
}

__int128 fun(__int128 n) {
    if (n < 2)
        return 1;
    return n * fun(n-2);
}

int main(){

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

    ull n;
    cin >> n;
    if (n % 2 == 1)
        cout << "0\n";
    else {
        ull n2 = n - (n % 10);
        ull t = n2 / 10;
        ull ans = t;
        while (t >= 5) {
            ans += (t / 5);
            t /= 5;
        }
        cout << ans << '\n';
    }
    
    return 0;
}

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

int solve(string s) {
  int ans = 0, cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
      cnt++;
    } else {
      cnt = 0;
    }
    ans = max(ans, cnt);
  }
  return ans;
}
int main() {
  string s;
  cin >> s;
  cout << solve(s) << endl;
}


Measured memory_bytes: 3600
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#include <climits>
#include <iomanip>
#define endl "\n"
#define debug(x) cout << #x << " : " << x << endl;
#define debug2(x, y) cout << #x << " : " << x  << ", " << #y << " : " << y << endl;
#define FASTIO ios_base::sync_with_stdio(false),cin.tie(0);
typedef long long ll;
using namespace std;

int main()
{
	FASTIO
	
	ll n;
	cin >> n;
	
	ll ans = 0;
	for(ll i = 1; i <= n; i ++)
	{
		ll last = n / i;
		ans = ans + (i *  (last * (last + 1))) / 2;
	}	
	cout << ans << endl;
}

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

int main() {
  string s;
  cin >> s;
  int cnt = 0, mx = 0;
  for (auto& c : s) {
    if (c == 'A' || c == 'T' || c == 'C' || c == 'G') {
      cnt++;
    } else {
      cnt = 0;
    }
    // cout << cnt << endl;
    mx = max(cnt, mx);
  }
  cout << mx << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

#define N 100

int main(){

  int n,p[N+1],m[N+1][N+1],x=1,i,j,l,k;

  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d%d",&p[i-1],&p[i]);
  }

  for(i=0;i<=n;i++){
    m[i][i]=0;
  }

  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){

      j=i+l-1;
      m[i][j]=1000000000;
      for(k=i;k<=j;k++){
	m[i][j]=fmin(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      }
    }
  }
    printf("%d\n",m[1][n]);


  return 0;
}



Measured memory_bytes: 2108
#include<stdio.h>
#define NIL -1

struct Node{
    int parent;
    int left;
    int right;
};

Node T[10000];

//reorder
void preParse(int u){
    if(u==NIL) return;
    printf(" %d", u);
    preParse(T[u].left);
    preParse(T[u].right);
}

//inorder
void inParse(int u){
    if(u==NIL) return;
    inParse(T[u].left);
    printf(" %d", u);
    inParse(T[u].right);
}

//postorder
void postParse(int u){
    if(u==NIL) return;
    postParse(T[u].left);
    postParse(T[u].right);
    printf(" %d", u);
}

int main(){

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

    for(int i=0; i<n; i++) T[i].parent = NIL;
    for(int i=0; i<n; i++){
        int v, l, r;
        scanf("%d %d %d", &v, &l, &r);
        T[v].left = l;
        T[v].right = r;
        if(l!=NIL) T[l].parent = v;
        if(r!=NIL) T[r].parent = v;
    }
    int root;
    for(int i=0; i<n; i++) if(T[i].parent==NIL) root = i;

    printf("Preorder\n");
    preParse(root);
    printf("\n");
    printf("Inorder\n");
    inParse(root);
    printf("\n");
    printf("Postorder\n");
    postParse(root);
    printf("\n");

    return 0;
}


Measured memory_bytes: 2732
#include<bits/stdc++.h>
#define test int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define endl "\n"
typedef long long ll;
using namespace std;

int main()
{
    string s,t;
    cin>>s>>t;
    int mx=0;

    for(int i=0;i<s.size()-t.size()+1;i++)
    {
        int cnt=0;
        for(int j=i,k=0;k<t.size();k++,j++)
        {
            if(s[j]==t[k])
            {
                cnt++;
            }
        }
        mx=max(cnt,mx);

    }

    cout<<t.size()-mx<<endl;


 return 0;



}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using Map = map<char,ll>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;



int main(){
    ll N;
    cin >> N;
    vector<ll> a(N+1,0);
    for(ll i=0;i<N;i++){
        cin>>a[i+1]
    ;}
    deque<ll> deq;
    for(ll i=1;i<=N;i++){
        ll k;
        for(ll j=a.size()-1;j>=1;j--){
            if(a[j]==j){deq.emplace_front(j);k=j;break;}
            if(j==1){cout<<-1<<endl;return 0;}
        ;}
        vector<ll> b(a.size()-1,0);
        for(ll i=1;i<=k-1;i++){
            b[i]=a[i];
        ;}
        for(ll i=k;i<=a.size()-2;i++){
            b[i]=a[i+1];
        ;}
        a.pop_back();
        for(ll i=1;i<=a.size()-1;i++){
            a[i]=b[i];
        ;}
    ;}
    for(ll i=0;i<N;i++){
        cout<<deq.front()<<endl;
        deq.pop_front();
    ;}
return 0;
}


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

int main()
{
    int n;
    cin >> n;
    long double price[n];
    char name[n][5];
    long double ans=0.0;
    for (int i=0; i<n; i++){
        cin >> price[i] >> name[i];
        if(name[i][0]=='J'){
            ans+=price[i];
        }else if(name[i][0]=='B'){
            ans=ans+price[i]*380000.0;
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
use proconio::{input, fastout, marker::Usize1};
use std::collections::{VecDeque, HashMap};

#[fastout]
fn main() {
    input! {
        n: usize, m: usize,
        arr: [(Usize1, Usize1); m],
    }

    let mut map: Vec<Vec<usize>> = vec![vec![]; n];
    for (a, b) in arr {
        map[a].push(b);
        map[b].push(a);
    }

    let mut hm: HashMap<usize, usize> = HashMap::new();
    let mut queue: VecDeque<usize> = VecDeque::new();
    hm.insert(0, 0);
    queue.push_back(0);
    while !queue.is_empty() {
        let r = queue.pop_front().unwrap();
        for i in &map[r] {
            if !hm.contains_key(i) {
                hm.insert(*i, r);
                queue.push_back(*i);
            }
        }
    }

    if hm.len() == n {
        println!("Yes");
        for i in 1..hm.len() {
            println!("{}", hm.get(&i).unwrap()+1);
        }
    } else {
        println!("No");
    }
}


Measured memory_bytes: 17464
combinations' :: Int -> [a] -> [[a]]
combinations' n xs = comb n xs [] [] where
  comb 0 _      ys zs = reverse ys : zs
  comb _ []     _  zs = zs
  comb n (x:xs) ys zs = comb (n - 1) xs (x:ys) (comb n xs ys zs)

solve :: [Int] -> Int
solve [n,x] = length $ filter ((== x) . sum) $ combinations' 3 [1..n]
solve _ = undefined

main :: IO ()
main  = getContents
    >>= return . takeWhile (/= [0,0]) . map (map read) . map words . lines
    >>= return . map solve
    >>= mapM_ print

Measured memory_bytes: 5512
from collections import deque
def tsort():
    que=deque([i for i,c in enumerate(In) if c==0])
    l=[]
    while que:
        v=que.popleft()
        l.append(v)
        for nv in G[v]:
            In[nv]-=1
            if In[nv]==0:
                que.append(nv)
    if len(l)!=P:
        print(-1)
        exit()
    return l
    
def setID():
    t=0
    ID=[[None]*N for i in range(N)]
    for i in range(N):
        for j in range(i+1,N):
            ID[i][j]=t
            t+=1
    for i in range(N):
        for j in range(N-1):
            a,b=i,A[i][j]
            if(a>b):
                a,b=b,a
            A[i][j]=ID[a][b]
    return t
N=int(input())
A=[list(map(lambda x:int(x)-1,input().split())) for i in range(N)]
P=setID()
In=[0]*P
G=[[] for i in range(P)]
for i in range(N):
    for j in range(N-2):
        G[A[i][j]].append(A[i][j+1])
        In[A[i][j+1]]+=1
srted=tsort()
dp=[1]*P
for v in srted:
    for nv in G[v]:
        dp[nv]=max(dp[nv],dp[v]+1)
print(max(dp))

Measured memory_bytes: 137188
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#define mprint(x) printf(FORMATCONVERSION(x),(x))
#define FORMATCONVERSION(x) _Generic((x),\
                                    int:"%d",unsigned int:"%u",\
                                    double:"%lf",long long int:"%lld",\
                                    unsigned long long int:"%llu",\
                                    char :"%c",char*:"%s")
 
int* StalinSort(int len,int* array,int* sorted_ar_size){

    int* ret_ar = NULL;
    (*sorted_ar_size) = 1;
    ret_ar = (int*)calloc((size_t)len,sizeof(int));
    ret_ar[0] = array[0];
    for(int i = 1;i < len;i++){
        if(ret_ar[(*sorted_ar_size) - 1] > array[i]){
            ++(*sorted_ar_size);
            ret_ar[(*sorted_ar_size) - 1] = array[i];
        }
    }
    if(realloc(ret_ar,(size_t)*sorted_ar_size * sizeof(int)) == NULL){
        return NULL;
    }
    return ret_ar;
}
int main(void){
    int n;
    scanf("%d",&n);
    int array[n];
    for(int i = 0;i < n;i++){
        scanf("%d",&array[i]);
    }
    int ans;
    int *musfree = StalinSort(sizeof(array) / sizeof(int),array,&ans);
    mprint(ans);
    free(musfree);
    return 0;
}



Measured memory_bytes: 1664
#ABC158 C - Tax Increase

A,B = map(int,input().split(' '))

a = B * 10
b = (B+1) * 10

flag = False
for i in range(a,b):
    if((int)(i*0.08) == A):
        flag = True
        print(i)
        break

if(flag == False):
    print(-1)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		//n
		String temp = scanner.nextLine();
		int n = Integer.parseInt(temp);
		//しりとり
		int flag = 0;
		String[] list = new String[n];
		for(int i = 0; i < n; i++) {
			list[i] = scanner.nextLine();
			if(i != 0) {
				if(list[i].charAt(0) != list[i - 1].charAt(list[i - 1].length() - 1)) {
					flag++;
					break;
				}
			}
			for(int j = 0; j < i; j++) {
				if(list[i].equals(list[j])) {
				flag++;
				break;
				}
			}
		}
		if(flag != 0) {
			System.out.println("No");
		}else {
			System.out.println("Yes");
		}
	}

}

Measured memory_bytes: 21716
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import java.util.StringTokenizer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    public static void main(final String[] args) {
        final FastScanner scanner = new FastScanner(System.in);
        final int n = scanner.nextInt();
        final List<Integer> list = IntStream.range(0, n)
            .mapToObj(i -> scanner.nextInt())
            .collect(Collectors.toList());

        long sum = list.get(0) - 1;
        long min = 2;

        for(int i = 1;i<n;i++){
            final int value = list.get(i);
            if(value < min){
                continue;
            }else if(value == min){
                min++;
                continue;
            }

            sum += (value - 1) / min;
        }

        System.out.println(sum);
    }

    private static class FastScanner {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(final InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

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

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


Measured memory_bytes: 51236
#include <iostream>
#include <vector>
#include <queue>
#include<map>
#include<algorithm>
#include<set>
#define rep(i,n) for(int i = 0;i < n;i++)
#define req(i,n) for(int i = 1; i<=n;i++)
#define ALL(a) a.begin(),a.end()
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
    std::fill((T*)array, (T*)(array + N), val);
}
typedef long long int ll;
vector<vector<int>> G;
vector<bool> visit;
vector<int> point;
void dfs(int a,int p) {
    for (int i : G[a]) {
        if (i == p) continue;
        point[i] += point[a];
        dfs(i,a);
    }
}
int main() {
    int n, q,a,b; cin >> n >> q;
    G.resize(n);point.resize(n, 0); visit.resize(n,0);
    rep(i, n-1) {
        cin >> a >> b; a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }rep(i, q) {
        cin >> a >> b; a--;
        point[a] += b;
    }dfs(0,0);
    for (int i : point) cout << i << " ";
    cout << endl;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

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

void Main()
{
	int n, l;
  	cin >> n >> l;
  	int ans;
	if(l>=0){
    	ans = (n-1)*n/2 + (n-1)*l;
    } 
    else if(n+l>0){
    	ans = (n-1)*n/2 + n*l;
    }
  	else{
    	ans = (n-1)*(n-2)/2 + (n-1)*l;
    }
	cout << ans << endl;
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}

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

using namespace std;

int N;
long long int K;

long long int MOD = 1000000007;

vector<vector<long long int> > A,a ;

vector<vector<long long int> > PROD(vector<vector<long long int> > A, vector<vector<long long int > > B) {

	vector<vector<long long int> > tmp;

	vector<long long int> V;
	for (int i = 0; i <= N; i++) { V.push_back(0); }
	for (int i = 0; i <= N; i++) { tmp.push_back(V); }

	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			long long int sum = 0;
			for (int k = 1; k <= N; k++) {
				sum += A[i][k] * B[k][j];
				sum %= MOD;
			}
			tmp[i][j] = sum;
		}
	}

	return tmp;
}

vector<vector<long long int> > POW(long long int K) {


	if (K == 1) { return a; }
	vector<vector<long long int> >  tmp;

	/*vector<long long int> V;
	for (int i = 0; i <= N; i++) {
		V.push_back(0);
	}

	for (int i = 0; i <= N; i++) {
		tmp.push_back(V);
	}*/

	if (K % 2 == 1) { return PROD(a, POW(K - 1)); }
	else {
		tmp = POW(K / 2);
		return PROD(tmp, tmp);
	 }

}

int main(void) {


	cin >> N >> K;

	vector<long long int> V;
	for (int i = 0; i <= N; i++) { V.push_back(0); }
	for (int i = 0; i <= N; i++) { a.push_back(V); }

	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			cin >> a[i][j];
		}
	}


	A = POW(K);

	long long int ans = 0;

	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			ans += A[i][j];
			ans %= MOD;
		}
	}

	cout << ans << endl;
	//system("pause");
	return 0;
}

Measured memory_bytes: 764
#include<iostream>
#include<string.h>
#include<cmath> 
#include <iomanip>

using namespace std;

const double PI = 3.14159265359;

int main() 
{
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  double ang1,ang2;
  ang2 = 2*PI * 1.0 * M / 60;
  ang1 = 2*PI * 1.0 * H / 12 + ang2/12 ;
  
//  cout << ang1 << " " << ang2 << endl;
  
   
  double a1 =   A * cos(ang1);
  double a2 =   A * sin(ang1);
  double b1 =   B * cos(ang2);
  double b2 =   B * sin(ang2);
  
//  cout << a1 <<" " << a2 << " " << b1 << " " << b2 << endl;
  
  double x = abs(a1 -b1);
  double y = abs(a2 -b2);
  
  double ret =   sqrt(x*x+y*y);
  cout << std::setprecision(13) << ret;  
  
  return 0;  
}

Measured memory_bytes: 4088
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define PF push_front
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vl vector<LL>
#define vii vector<vi>
#define vll vector<vl>

const double pi = 3.14159265358979323846264;
const int mod=1000000007;

int main(){
	LL n;
    cin>>n;
    LL ans=0;
    FOR(i,1,n+1){
        FOR(j,1,n+1){
            LL k=i*j;
            if(k>n)break;
            ans+=k;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3636
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

X=gets.to_i
puts X.lcm(360)/X

Measured memory_bytes: 14276
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
const ll M = 1e9 + 7;

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

  int ans = 0;
  for (int i = l; i <= r; i++) {
    if (i%d == 0) ans++;
  } 
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 3636
package main

import (
	"fmt"
)

func main() {
	for {
		var a int
		fmt.Scan(&a)
		if a == 0 {
			break
		}
		rs := 0

		for i := 0; i < 10; i++ {
			for j := 0; j < 10; j++ {
				for k := 0; k < 10; k++ {
					for l := 0; l < 10; l++ {
						if i+j+k+l == a {
							rs++
						}
					}
				}
			}
		}
		fmt.Println(rs)
	}
}



Measured memory_bytes: 1076
#include<iostream>
#include<queue>

using namespace std;
static const int N=100;
static const int INFTY = (1<<21);

int n,Mtw[N][N];
int d[N];

void bfs(int s){
    queue<int> q;
    q.push(s);
    for(int i=0;i<n;i++)d[i]=INFTY;
    d[s]=0;
    int utw;
    while(!q.empty()){
        utw=q.front(); q.pop();
        for(int v=0;v<n;v++){
            if(Mtw[utw][v]==0)continue;
            if(d[v]!=INFTY)continue;
            d[v]=d[utw]+1;
            q.push(v);
        }
    }
    for(int i=0;i<n;i++){
        cout<<i+1<<" "<<((d[i]==INFTY)?(-1):d[i])<<endl;
    }
}

int main(){
    int utw,ktw,vtw;

    cin >> n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++)Mtw[i][j]=0;
    }

    for(int i=0;i<n;i++){
        cin>>utw>>ktw;
        utw--;
        for(int j=0;j<ktw;j++){
            cin >> vtw;
            vtw--;
            Mtw[utw][vtw]=1;
        }
    }

    bfs(0);

    return 0;
}


Measured memory_bytes: 3116
a = list(map(int, input().split()))
b = list(map(int, input().split()))
count2 = 0
for i in range(a[0]):
    c = list(map(int, input().split()))
    count = 0
    for j in range(a[1]):
        count += b[j]*c[j] 
    if count + a[2] > 0:
        count2 += 1
print(count2)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#ifdef ENABLE_DEBUG_OUTPUT
#define DEBUG_LOG(s) cout << s << endl;
#else
#define DEBUG_LOG(s) void();
#endif

int main(){
    string s;
    cin >> s;

    for (auto i = ((int)s.size() - 1) / 2; i > 0; i--) {
        // cout << s.substr(0, i) << " " << s.substr(i, i) << endl;
        if(s.substr(0, i) == s.substr(i, i)) {
            cout << 2*i << endl;
            return 0;
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  long long int N,A,B;
  long long int i;
  long long int h[100000];
  long long int K;
  long long int left,right;
  long long int sum;

  scanf("%lld %lld %lld",&N,&A,&B);
  //printf("%d\n", N);

  for(i=0;i<N;++i){
    scanf("%llu",&h[i]);
  }

  left=0;
  right=1000000000;

  while(left!=right){
    K=(right+left)/2;
    sum=0;
    for(i=0;i<N;i++){
      if(h[i]-K*B > 0){
        // sum += (h[i]-K*B)%(A-B) ? (h[i]-B*K)/(A-B)+1 : (h[i]-B*K)/(A-B);
        if((h[i]-K*B)%(A-B)==0){
          sum += (h[i]-B*K)/(A-B);
        }else{
          sum += (h[i]-B*K)/(A-B)+1;
        }
      }
    }
    if(sum <= K){
      right=K;
    }else{
      left=K+1;
    }
  }

  printf("%lld\n", left);

  return 0;
}


Measured memory_bytes: 896
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
 
struct restaurant{
    std::string city;
    int score;
    int index;
    restaurant(std::string c = "", int s = 0) : city(c), score(s){}
    bool operator<(const restaurant &A){
        if(this->city == A.city){
            return this->score > A.score;
        }
        return this->city < A.city;
    }
};
 
int main(){
    int n;
    std::cin >> n;
    std::vector<restaurant> input(n);
    for(int i = 0; i < n; i++){
        std::cin >> input[i].city >> input[i].score;
        input[i].index = i + 1; // to 1 origin
    }
 
    std::sort(input.begin(), input.end());
 
    for(int i = 0; i < n; i++){
        std::cout << input[i].index << std::endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int a,b;
  while(cin>>a){
    cin>>b;
    a+=b;
    int i=0;
    while(a!=0){
      a=a/10;
      i++;
    }
    cout<<i<<endl;
  }
  return(0);
}
  

Measured memory_bytes: 3012
N=int(input())

a_list = list(map(int,input().split()))

# a1, a2, a3..で割られた際一番余りの大きい数はそれぞれ a1-1, a2-1, a3-1..なのでそれらの合計が答え

print(sum(a_list)-N)


Measured memory_bytes: 3316
#include<iostream>
#include<cstdio>
#include<string>
#include<map>
#include<algorithm>
using namespace std;

int main(){
  pair<int,char> shop[5];
  int am[5],pm[5];

  while(1){
    cin >> am[0] >> pm[0];
    if(am[0] == 0 && pm[0] == 0)break;

    for(int i=1;i<5;i++){
      cin >> am[i] >> pm[i];
    }
    
    for(int i=0;i<5;i++){
      shop[i].first = am[i] + pm[i];
      shop[i].second = 'A' + i;
    }
  
    sort(shop,shop+5);

    cout << shop[4].second << ' ' << shop[4].first << endl;
  }
  return 0;
}

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

using namespace std;

#define cin_desync()                                                           \
    do {                                                                       \
        ios_base::sync_with_stdio(false);                                      \
        cin.tie(0);                                                            \
    } while (0)

#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
    const char *comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | ";
    __f(comma + 1, args...);
}

#else
#define trace(...)
#endif // ifndef ONLINE_JUDGE

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main() {
    vector<pii> E;
    
    int N;
    cin >> N;

    int n = (N % 2) ? N - 1 : N;
    for (int i = 1; i <= n; ++i) {
        for (int j = i + 1; j <= n; ++j) {
            if (i + j != n + 1) {
                E.push_back({i, j});
            }
        }
    }

    if (n != N) {
        for (int i = 1; i <= n; ++i) {
            E.push_back({i, N});
        }
    }

    cout << E.size() << endl;
    for (auto &p : E) {
        cout << p.first << ' ' << p.second << '\n';
    }
}


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

int main()
{
  ll n;
  cin >> n;
  vector<pair<ll,ll> > v;
  rep(n)
  {
    ll x,l;
    cin >> x >> l;
    v.push_back(make_pair(x+l,x-l));
  }
  sort(v.begin(),v.end());

  ll cnt = 0;
  ll cur = LLONG_MIN;
  for (auto p:v)
  {
    if (p.second < cur) continue;
    cur = p.first;
    cnt++;
  }

  cout << cnt << endl;

  return 0;
}

Measured memory_bytes: 2420