akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define int long long
int mian(){
	int n;
	int tot=0;
	int now=100;
	cin>>n;
	while(now<n){
		++tot;
		now=now*1.01;
	}
	cout<<tot<<endl;
	return 0;
}
signed main(){
	int t=1;
//	cin>>t;
	while(t--)
		mian();
	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i )
typedef std::pair<int,int> pint;

using namespace std;
typedef long long ll;

int main(){
    int N,D; cin >> N >> D;
    vector<pair<ll,ll>> list(N);
    rep (i,N){
        ll x,y;
        cin >> x >> y;
        list[i].first = x;
        list[i].second = y;
    }
    int count = 0;
    rep (i,N){
        ll tmp = pow(list[i].first,2) + pow(list[i].second,2);
        if (tmp <= pow(D,2)){
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 6332
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<map>
#include<vector>
#include<set>
#include<cctype>
#include<string>
#include<cmath>

#define rep(a,b) for(register int i=a;i<=b;i++)
#define red(a,b) for(register int i=a;i>=b;i--)
#define  ULL unsigned long long
#define  LL long long
const int MOD = 1000000007;
using namespace std;

int N;
int M;
LL ans = 1;
vector<int >G;
map<pair<int, int>,int >map0;
int inv(int a) {
	//return fpow(a, MOD-2, MOD);  
	return a == 1 ? 1 : (long long)(MOD - MOD / a) * inv(MOD % a) % MOD;
}
LL C(LL n, LL m)
{
	if (m < 0)return 0;
	if (n < m)return 0;
	if (m > n - m) m = n - m;

	LL up = 1, down = 1;
	for (LL i = 0; i < m; i++) {
		up = up * (n - i) % MOD;
		down = down * (i + 1) % MOD;
	}
	return up * inv(down) % MOD;
}

LL mul(LL a, LL b)
{
	return (a*b) % MOD;
}

long long quickpow(long long n, long long base) {
	long long res = 1;
	while (n) {
		if (n & 1) {
			res = res * base % MOD;
		}
		n >>= 1;
		base = base * base % MOD;
	}
	return res;
}//快速幂 
int pre;

int main()
{
	cin >> N >> M;
	int lim = sqrt(M);
	rep(2, lim)
	{
		if (M%i == 0)
		{
			int cnt = 0;
			while (M%i == 0)
			{
				M /= i;
				cnt++;
			}
			ans = ans * C(N + cnt - 1, N - 1) % MOD;
		}
	}
	if (M != 1)
	{
		ans =( ans * N )% MOD;
	}
	cout << ans << endl;
}




Measured memory_bytes: 256
using System;

namespace AOJ0007
{
    class Program
    {
        static void Main()
        {
            var money = 100000L;
            var weeks = int.Parse((Console.ReadLine() ?? ""));

            for (var i = 0; i < weeks; i++)
            {
                money = (long) Math.Ceiling(money*1.05/1000)*1000;
            }

            Console.WriteLine(money);
        }
    }
}

Measured memory_bytes: 5616
import java.util.*;
public class Main {
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int[] intArray = Arrays.stream(sc.nextLine().split(" ")) //" "で区切ってString配列へ
    .mapToInt(Integer::parseInt) //数値にして
	.toArray(); //配列へ
		//計算
		if (intArray[0] >= intArray[1] && intArray[0] >= intArray[2]){
			// 出力
			System.out.println(intArray[0]*10 + intArray[1] + intArray[2]);
		}else if(intArray[1] >= intArray[0] && intArray[1] >= intArray[2]){
			// 出力
			System.out.println(intArray[1]*10 + intArray[0] + intArray[2]);
		}else{
			// 出力
			System.out.println(intArray[2]*10 + intArray[1] + intArray[0]);
		}

	}
}

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

int main(int argc, char *argv[])
{
    auto prime = [](int a){
        if(a <= 1) return false;
        for(int i = 2; i * i <= a; i++){
            if((a % i) == 0) return false;
        }
        return true;
    };
    for(;;) {
        int a, d, n;
        cin >> a >> d >> n;
        if(a == 0) break;
        for(;;) {
            while(!prime(a)) {
                a += d;
            }
            n--;
            if(n == 0) break;
            a += d;
        }
        cout << a << endl;
    }
    return 0;
}


Measured memory_bytes: 3072
#include <iostream>

using namespace std;

int sum_of_digits(int i){
    string s = to_string(i);
    int v=0;
    for (i=0;i<s.size();i++){
        v+=atoi(string(1,s[i]).c_str());
    }
    return v;
}

int sum_of_digits2(int i){
    int sum = 0;
    while (i>0){
        sum += i%10;
        i/=10;
    }
    return sum;
}

int main(void){
    int n,a,b;
    int sum = 0;

    cin >> n >> a >> b;

    for (int i=1;i<=n;i++){
        int v = sum_of_digits(i);
        if ((v>=a)&&(v<=b)) sum+=i;
    }
    cout << sum;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define speed                     \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
#define ll long long
#define pb push_back
#define mem1(a) memset(a, -1, sizeof(a))
#define mem0(a) memset(a, 0, sizeof(a))
#define endl "\n"
#define mod 1000000007
#define mod1 998244353
#define ff first
#define ss second
#define MAX 500005
#define N 300005
#define INF 1000000009
#define all(v) v.begin(), v.end()
#define sbit(a) __builtin_popcount(a)
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef pair<ll, ll> pll;
typedef pair<pll, ll> ppl;
typedef map<ll, ll> mpll;
typedef map<vector<ll>, ll> mpvl;
ll power(ll x, ll y, ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0)
        return 0;
    while (y > 0)
    {

        if (y & 1)
            res = (res * x) % p;

        y = y >> 1;
        x = (x * x) % p;
    }

    return res;
}

void solve()
{
    string s, t;
    cin>>s>>t;
    ll n=s.length();
    ll m=t.length();
    ll mn=1e18;
    for(ll i=0;i<=n-m;i++)
    { 
        ll tmp=i;
        ll cnt=0;
        for(ll j=0;j<m;j++)
        {
             if(s[tmp]!=t[j])
             {
                 cnt++;
             }
            tmp++;  
        }
        mn=min(mn,cnt);

    }
    cout<<mn<<endl;
}
int main()
{

    speed;

    ll kk;
    kk = 1;
    // cin >> kk;
    while (kk--)
    {

        solve();
    }
    return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <queue>
#include <set>
#include <map>
#include <deque>
#include <iomanip>
#include <cstdio>
#include <stack>
#include <numeric>
#include <cassert>
using namespace std;
typedef  long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define  MP make_pair
#define  PB push_back
#define inf 1000000007
#define mod 1000000007
#define rep(i,n) for(int i=0;i<(int)(n);++i)

int main(){
    int n;
    cin >> n;
    cout << n* n * n << endl;



    return 0;
}

Measured memory_bytes: 888
/*
  Vivek Rathi
  CSE 3rd Year
  MNNIT
  THUMB RULE - THINK FOR DP FIRST AND THEN GREEDY!!!
*/
#include<bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ll long long int
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define present(c,x) ((c).find(x) != (c).end())
#define null NULL
#define mp make_pair
#define sz(x)	(ll)x.size()
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define inf 1e18
#define flush fflush(stdout);
#define endl '\n'
//unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
//shuffle (foo.begin(), foo.end(), std::default_random_engine(seed));
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<ll, null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
ll modpower(ll a,ll b,ll c)
{
	ll res=1;
	while(b)
	{
		if(b&1LL)
			res=(res*a)%c;
		a=(a*a)%c;
		b>>=1;
	}
	return res;
}
//-------------------------------Template--Above-----------------------------------------------

int main()
{
	boost
	ll n;
      	cin>>n;
      	ll mod=n%1000;
      	cout<<(1000-mod)%1000<<endl;
	return 0;
}


Measured memory_bytes: 3644
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        s:Chars,
    }
    let n = s.len();
    let mut dp = vec![vec![0; n]; 102];

    for i in 0..n {
        if s[i] == 'L' {
            dp[0][i] = i - 1;
        } else {
            dp[0][i] = i + 1;
        }
    }

    for i in 0..100 {
        for j in 0..n {
            let p = dp[i][j];
            dp[i + 1][j] = dp[i][p];
        }
    }
    let mut ret = vec![0; n];
    for &x in dp[80].iter() {
        ret[x] += 1;
    }
    for &x in ret.iter() {
        print!("{} ", x);
    }

    println!("\n");
}


Measured memory_bytes: 82248
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            B();
        }

        static void B()
        {
            var S = Read();
            var hash = new HashSet<char>();
            foreach (var s in S)
                hash.Add(s);

            Console.WriteLine(hash.Count == S.Length ? "yes" : "no");
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int DigitsSum(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static IList<string> ReadSplit() => Read().Split().ToList();
        static IList<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
    }
}

Measured memory_bytes: 13396
#include <math.h>

#include <algorithm>
#include <cassert>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
#define PI 3.14159265358979323846264338327950L
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))

int main() {
  string S;
  string T;
  cin >> S >> T;
  int count_ = 0;
  rep(i, S.size()) {
    if (S[i] != T[i]) {
      count_++;
    }
  }
  cout << count_ << endl;
}


Measured memory_bytes: 3916
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
#include<vector>
#include<queue>
#define lson (rt << 1)
#define rson (rt << 1 | 1)
#define gmid ((l+r) >> 1)
#define ll long long
using namespace std;

char s[100050],s1[200050],s2[200050];

int main()
{
    int f=0,n,l1=0,l2=0,t,x;
    char c;
	cin>>s;
	cin>>n;
	while(n--)
	  {
	  	  cin>>t;
	  	  if(t==1)
	  	    {
	  	    	f=(f+1)%2;
	  	    	continue;
			}
		  scanf("%d %c",&x,&c);
		  if((x+f)%2==1)
		    {
		    	l1++;
		    	s1[l1]=c; 
			}	
		  else
		    {
		    	l2++;
		    	s2[l2]=c;
			}	
	  } 
	if(f==0) {  
	for(int i=l1;i>=1;--i)
	  cout<<s1[i];
	cout<<s;
	for(int i=1;i<=l2;++i)
	  cout<<s2[i];    }
	else
	{
		for(int i=l2;i>=1;--i)
	  cout<<s2[i];
	int len=strlen(s);
	for(int i=len-1;i>=0;--i)
	  cout<<s[i];
	for(int i=1;i<=l1;++i)
	  cout<<s1[i]; 
	}  
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, m, n) for (int i = m; i < n; i++)
#define repr(i, m, n) for (int i = m; i >= n; i--)
#define db(x) cout << #x << "=" << x << endl;
template <class T>
bool maxi(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool mini(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
#define INF2 1000000000000000037
#define INF  1000000007
#define MOD  1000000007
#define PI (acos(-1))
#define EPS 1e(-9);
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
//--GLOBAL---------------------------------

//--MAIN-----------------------------------
void Main() {
    int N,K;
    cin>>N>>K;
    cout<< ((N-1)+K-2)/(K-1)<<"\n";
}

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


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    long long int h,w,a,b;

    cin>>h>>w>>a>>b;
    if(a==0||b==0){
        if(a==0&&b==0){
            REP(i,h){
                REP(j,w){
                    cout << 1;
                }
                cout << endl;
            }
        }else if(a==0){
            
            REP(i,b){
                REP(j,w){
                    cout << 1;
                }
                cout << endl;
            }
            REP(i,h-b){
                REP(j,w){
                    cout << 0;
                }   
            cout << endl;
            }
        }else if(b==0){
            REP(j,h){
            REP(i,a){
                cout << 1;
            }
            REP(i,w-a){
                cout << 0;

            }
            cout << endl;
            }
        }else{
            cout << "No" << endl;
        }
    }else{
    REP(j,h){
         
        REP(i,w){

            //cout << i << " " << j << " ";
            if(i<a&&j<b){
                cout<<1;
            }else if(a<=i&&i<2*a&&j<b){
                cout<<0;
            }else if(2*a<=i&&j<b){
                cout<<1;
            }else if(i<a&&b<=j&&j<2*b){
                cout<<0;
            }else if(a<=i&&i<2*a&&b<=j&&j<2*b){
                cout<<1;
            }else if(2*a<=i&&b<=j&&j<2*b){
                cout<<0;
            }else if(i<a&&2*b<=j){
                cout<<1;
            }else if(a<=i&&i<2*a&&2*b<=j){
                cout<<0;
            }else if(2*a<=i&&2*b<=j){
                cout<<1;
            }

        }
        cout<<endl;
    }
    }
    return 0;
}


Measured memory_bytes: 1280
l=list(input())
n=len(l)
ans1=0
ans2=0
for i in range(n):
    if i%2==0:
        if l[i]=='0':
            ans1+=1
    else:
        if l[i]=='1':
            ans1+=1
            
for i in range(n):
    if i%2==0:
        if l[i]=='1':
            ans2+=1
    else:
        if l[i]=='0':
            ans2+=1 
print(min(ans1,ans2))
   

Measured memory_bytes: 3956
#include <bits/stdc++.h>
const int mmax = 1e6;
using namespace std;
long long n, m, ans;
bool vis[mmax];
vector <int> adj[mmax];
void dfs(int u)
{
    vis[u] = 1;
    for (int v : adj[u])
        if (!vis[v]) dfs(v);
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    //freopen("test.inp", "r", stdin);
    cin >> n >> m;
    for (int i = 1; i <= m; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    for (int i = 1; i <= n; i++)
        if (!vis[i])
        {
            dfs(i);
            ans++;
        }
    cout << --ans;
    return 0;
}


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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;

void solve() {
    int a;
    cin >> a;

    cout << a + a*a + a*a*a << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}


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

int main(){
  int N;
  cin >> N;
  map<int,int> m;
  for (int i=0;i<N;i++){
    int x;
    cin >> x;
    m[x]++;
  }
  int count=0;
  for (auto x:m){
    count+=x.second-1;
  }
  int s=m.size();
  if (count%2==0){
    cout << s << endl;
  }
  else {
    cout << s-1 << endl;
  }
}

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

int main(){
	int A, B, C, X, count = 0;
	cin >> A;
	cin >> B;
	cin >> C;
	cin >> X;
	for (int i = 0; i <= A; i++){
		for (int j = 0; j <= B; j++){
			for (int k = 0; k <= C; k++){
				if (i * 500 + j * 100 + k * 50 == X){
					count++;
				}
			}
		}
	}
	cout << count;
}

Measured memory_bytes: 256
import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

tmp = 0
for i in range(n):
    tmp+=abs(x[i]-y[i])
print(tmp)
tmp = 0
for i in range(n):
    tmp+=(x[i]-y[i])**2
print(math.sqrt(tmp))
tmp = 0
for i in range(n):
    tmp+=abs(x[i]-y[i])**3
print(tmp**(1/3))
tmp = 0
for i in range(n):
    tmp = max(tmp, abs(x[i]-y[i]))
print(tmp)
    


Measured memory_bytes: 5692
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [0]+list(map(int, input().split()))

count = b[a[0]-1]
for i in range(1, n):
    now = a[i]
    count += b[now-1]
    if now - a[i-1] == 1:
        count += c[now-1]

print(count)

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

int main() {
  long long n, s = 0 , t = 0 , u = 0;
  cin >> n;
  vector<char> c(n);
  for (long long i = 0; i < n; i++)
  {
    cin >> c[i];
    if (c[i] == 'R')
    {
      s++;
    }
    
  }
  for (long long i = 0; i < s; i++)
  {
    if (c[i] == 'W')
    {
      t++;
    }
    
  }
  for (long long i = s; i < n; i++)
  {
    if (c[i] == 'R')
    {
      u++;
    }
  }
  cout << max(t,u) << endl;
  return 0;
}

Measured memory_bytes: 3628
while True :
    n = int(input())
    if n == 0 :
        break
    key = list(map(int, input().split()))
    station = list(input())
    
    i = 0
    j = 0
    while True :
        if i == len(station) :
            break
        if j == len(key) :
            j = 0
        if 97 <= ord(station[i]) <= 122 :
            x = ord(station[i]) - key[j]
            if 71 <= x <= 96 :
                x -= 6
            elif 45 <= x <= 70 :
                x += 52
        elif 65 <= ord(station[i]) <= 90 :
            x = ord(station[i]) - key[j]
            if 39 <= x <= 64 :
                x += 58
            elif 13 <= x <= 38 :
                x += 52
        print(chr(x), end="")
        
        i += 1
        j += 1
    print()


Measured memory_bytes: 5624
#include<bits/stdc++.h>
using namespace std;
#define LL long long

int main(){
	// sengen
	int n;
	// nyuryoku
	cin >> n;
	double v[n];
	for(int i=0;i<n;i++){
		cin >> v[i];
	}
	sort(v,v+n);
	double ans = 0;
	// keisan
	for(int i=0;i<n;i++){
		if(i == 0) continue;
		if(i == 1){
			ans = (v[0] + v[1])/2;
			continue;
		}
		ans = (v[i] + ans)/2;
	}
	// syutsuryoku
	printf("%lf",ans);
}

Measured memory_bytes: 3768
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define pp pair<ll, pair<ll, ll>> 
#define fi first
#define se second

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

ll di[10000010];
ll M = 10000000;

int main() {
    Rep(i, 1, M){
        for(int j = i; j <= M; j += i) di[j]++;
    }

    ll n; cin >> n;
    ll ans = 0;
    Rep(i, 1, n){
        ans += i * di[i];
    }
    co(ans);


    return 0;
}


Measured memory_bytes: 81744
#include <string>
#include <iostream>
#include <stack>
#include <queue> // priority_queue も入ってる
#include <set>   // 要素数は size() で取得 multisetもある
#include <map>
#include <array> // sizeはコンパイル時定数で固定
#include <vector>
#include <numeric>   // accumulate, gcd
#include <algorithm> // count_ifに必要
#include <iomanip>   // cout << setprecision(15) << x で小数の出力精度を指定
#include <tuple>
#include <utility> //pair
#include <cmath>
#include <random>

using namespace std;
// 問題が起こるまでintは使用禁止2020-04-13
using ll = long long;

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

template <class InputIterator, class T>
bool contains_itr(InputIterator iterator, const T &value)
{
    if (find(iterator.begin(), iterator.end(), value) == iterator.end())
        return false;
    else
        return true;
}

template <class T>
bool contains_set(set<T> st, const T &value)
{
    if (st.find(value) == st.end())
    {
        return false;
    }
    else
    {
        return true;
    }
}

template <class InputIterator>
auto sum(InputIterator iterator)
{
    return accumulate(iterator.begin(), iterator.end(), 0);
}

// endは排他的(exclusive)なので注意
vector<ll> range(ll begin, ll end)
{
    vector<ll> result;
    for (ll i = begin; i < end; ++i)
    {
        result.push_back(i);
    }
    return result;
}

random_device seed_gen;
mt19937 engine(seed_gen());
// 0, 1, 2 のどれかが得られる一様分布
// uniform_int_distribution<> dist(0, 2);
// cout << dist(engine) << endl;
// みたいに、先に確率分布を宣言して、そこにengineを与えて使う。

// =========ここまでテンプレ============

int main()
{
      bool aho[60000000000];
  for(ll i=0;i<60000000000;++i){
    aho[i]=true;
    }
    ll n, x, t;
    cin >> n >> x >> t;
    ll m = n / x;
    if (n % x != 0)
    {
        ++m;
    }
  if(aho[600]){
    cout << t * m << endl;
    }
    return 0;
}


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


int main() {
    ll l, r;
    cin >> l >> r;
    ll mi = 2000000000;

    if (r - l > 2019) cout << 0;
    else {
        for (ll i = l; i < r; i++) {
            for (ll j = i + 1; j < r + 1; j++) {
                ll rem = (i * j) % 2019;
                mi = min(rem, mi);
            }
        }
        cout << mi;
    }
}


Measured memory_bytes: 256
a, b, c, d = map(int, input().split(' '))
count = 0
result = ''
while True:
    if count % 2 == 0:
        c -= b
        if c <= 0:
          result = 'Yes'
          break  
    else:
        a -= d
        if a <= 0:
            result = 'No'
            break
    count += 1
print(result)

Measured memory_bytes: 9180
N=int(input())  #数値入力
X = [0] * N
U = [0] * N

for i in range(N):
    X[i], U[i] = input().split()
    X[i] = float(X[i])

ans=0
for i in range(N):
    if U[i] =="JPY":
        ans += X[i]
    else:
        ans += X[i] * 380000

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1000000000;
const int MOD = (int)1e9 + 7;
template <class T>
inline T in()
{
    T x;
    cin >> x;
    return x;
}

signed main()
{
    int n = in<int>();
    int k = in<int>();
    for (int i = 0; i < n; i++)
    {
        char c = in<char>();
        if (k == i + 1)
        {
            c = tolower(c);
        }
        cout << c;
    }
    cout << "\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
using namespace std;

int main(int argc, const char * argv[]) {
    int d,n;
    cin >> d >> n;
    int num = 0;
    if(n == 100)
        n++;
    num = pow(100,d) * n;
    cout << num;
    return 0;
}



Measured memory_bytes: 256
import std.stdio;
import std.algorithm;
import std.math;
import std.conv;
import std.string;

T readNum(T)(){
  return readStr.to!T;
}

T[] readNums(T)(){
  return readStr.split.to!(T[]);
}

string readStr(){
  return readln.chomp;
}

void main(){
	bool finished = false;
	auto tax = readNums!int;
	foreach(i; 0 .. 1001){
		if(floor(i * 0.08) == tax[0] && floor(i * 0.1) == tax[1]){
			i.writeln;
			finished = true;
			break;
		}
	}
	if(!finished){
		writeln(-1);
	}
}


Measured memory_bytes: 256
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    L,R,d=pin()
    cnt=0
    for i in range(L,R+1):
        if i%d==0:cnt+=1

    print(cnt)
#%%submit!
resolve()


Measured memory_bytes: 61920
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll; 
int main(void){
    
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
    			cin >> A.at(i);
  	}
  	
  	ll sum =0;
  	ll answer =0; 
  	for(ll a=0; a<=N; a++){ 
  	    for(ll b=0; b<=N; b++){
  	        // 左からa, 右からb読んだ時の最大値の計算
  	        priority_queue<int, vector<int>, greater<int>> pq;
  	        sum =0;
  	        for(ll i=0; i<a; i++){
  	            sum+= A.at(i);
  	            pq.push(A.at(i));
  	        }
  	        for(ll j=0; j<b; j++){
  	            sum+= A.at(N-1-j);
  	            pq.push(A.at(N-1-j));
  	        }
  	        
  	        ll x = K - a - b ;
  	        while(pq.size()>0){
  	            ll y;
  	            y=pq.top();
  	            if(y<0 && x>0 ){
  	                sum -= y; 
  	                x--; 
  	            }
  	            pq.pop();
  	        }
  	        //if(a+b<=min(N,K)) cout<< a <<" "<< b <<" "<<sum<<" "<<endl;  
  	        if(a+b<=min(N,K)) answer = max( answer, sum ); 
  	    }
  	}
  	cout << answer; 
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector> 
#include <math.h> 
#include <map> 
#include <algorithm> 
using namespace std;
int main(void){
    long long n, m; cin >> n >> m;
    map<long long, long long> map;
    vector<long long> v(n);
    long long i = 0;
    long long ans = 0;
    while(i < n)  {
        long long tmp;
        cin >> tmp;
        if (map.count(tmp)) {
            map[tmp]++;
        } else {
            map[tmp] = 1;
            v.push_back(tmp);
        }
        i++;
    }
    i = 0;
    while(i < m)  {
        long long b,c;
        cin >> b >> c;
        if (map.count(c)) {
            map[c] += b;
        } else {
            map[c] = b;
            v.push_back(c);
        }
        i++;
    }
    sort(v.begin(), v.end(), greater<long long>());
    i = 0;
    while(i < v.size() && n > 0) {
        if (n > map[v[i]]) {
            ans += v[i] * map[v[i]];
            n -= map[v[i]];
        } else {
            ans += v[i] * n;
            n = 0;
        }
        i++;
    }
    cout << ans << endl;
}



Measured memory_bytes: 17976
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace AOJ0062
{
    class Program
    {
        static void Main()
        {
            foreach (var numbers in ReadInputs())
            {
                Console.WriteLine(CalculateBottomMost(numbers));
            }
        }

        public static IEnumerable<int[]> ReadInputs()
        {
            string line;
            while ((line = Console.ReadLine()) != null)
            {
                yield return line.ToCharArray().Select(c => int.Parse(c.ToString(CultureInfo.InvariantCulture))).ToArray();
            }
        }

        public static int CalculateBottomMost(int[] values)
        {
            if (values.Length == 1) return values[0];

            var newValues = new int[values.Length - 1];
            for (var i = 0; i < newValues.Length; i++)
            {
                newValues[i] = (values[i] + values[i + 1])%10;
            }

            return CalculateBottomMost(newValues);
        }
    }
}

Measured memory_bytes: 14096
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll mxn= 5e4+5;
// check for forloop
// intialize variable
// overflow
// go for easy solution
#define mod 1000000007
ll INF = 1000000000000000005LL;
//#define endl '\n'
void rishabh(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}
int main(){
    rishabh();
    int a,b,c,n;
    cin>>a>>b>>c>>n;
    int dp[n+1]={};
    dp[0]=1;
    for(int i=1;i<=n;i++){
        if(i-a>=0)
        dp[i]+=dp[i-a];
    }
    for(int i=1;i<=n;i++){
        if(i-b>=0)
        dp[i]+=dp[i-b];
    }
    for(int i=1;i<=n;i++){
        if(i-c>=0){
            dp[i]+=dp[i-c];
        }
    }
    cout<<dp[n];
}

Measured memory_bytes: 3616
#include <iostream>

using namespace std;

int main(void) {
    int X;
    cin >> X;

    int least = X / 105;
    int large = X / 100;
    for(int N=least; N<=large; N++) {
        if(100*N <= X && X <= 105*N) {
            cout << 1 << endl;
            return 0;
        }
    }
    cout << 0 << endl;
    return 0;
}


Measured memory_bytes: 256
n, k, s = map(int, input().split())

if s < 10**9:

  if k > 0: 
      aa = [s]*k + [s+1]*(n-k)
  elif k == 0:
      aa = [s+1]*n

else:
  aa =[s]*k + [1]*(n-k)

print(*aa)

Measured memory_bytes: 10824
X,N=map(int,input().split())
if N==0:
    print(X)
    exit()

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

D=[[]for i in range(201)]


for i in range(-99,102):
    D[i].append(i)
    D[i].append(abs(X-i))
#print(D)
    
T=sorted(D,key=lambda x:x[1])
#for i in range(N):
for i in range(201):
    if T[i][0] not in S:
        print(T[i][0])
        exit()



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

#define int long long
#define ll long long
#define ffor(i,n) for(int i = 0;i < (n); ++i)
#define fro(i,j,n) for(int i = (j);i < (n); ++i)
#define all(v) v.begin(),v.end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vpii vector<pii>
#define ff first
#define ss second
const int mod = 1e9 + 7;
template<typename T>
T add(T a,T b){
	return (a + b)%mod;
}
template<typename T>
T sub(T a,T b){
	return add(a,mod - b);
}
template<typename T>
T mul(T a,T b){
	return (a*b)%mod;
}

struct shop{
	int cost;
	vi book;
};
signed main(){
	int n,m,x;
	cin >> n >> m >> x;
	vector<shop> ar(n);
	ffor(i,n){
		cin >> ar[i].cost;
		ar[i].book.resize(m);
		ffor(j,m){
			cin >> ar[i].book[j];
		}
	}
	int ans = 1e18;
	ffor(i,(1<<n)){
		int wt = 0;
		vector<int> tot(m);
		ffor(j,n){
			if((1<<j)&i){
				wt += ar[j].cost;
				ffor(z,m){
					tot[z] += ar[j].book[z];
				}
			}
		}
		bool ok = true;
		ffor(j,m){
			if(tot[j] < x){
				ok = false;
				break;
			}
		}	
		if(ok){
			ans = min(ans,wt);
		}
	}
	if(ans == 1e18){
		cout << -1;
	}else{
		cout << ans;
	}
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define MOD 998244353 

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

ordered_set<ll> ors;

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

ll power(ll a, ll n, ll m)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans=(ans*a)%m;
        n>>=1;
        a=(a*a)%m;
    }
    return ans;
}

ll invmod(ll a, ll m)
{
    return power(a,m-2,m);
}

void solve(ll tt) {
    ll n,m,k;
    cin>>n>>m>>k;
    ll prea[n+1],preb[m+1];
    prea[0]=0;
    preb[0]=0;
    repf(i,1,n+1) {
        ll x;
        cin>>x;
        prea[i]=prea[i-1]+x;
    }
    repf(i,1,m+1) {
        ll x;
        cin>>x;
        preb[i]=preb[i-1]+x;
    }
    ll ans=0;
    repf(i,0,n+1) {
        ll id=upper_bound(preb,preb+m+1,k-prea[i])-preb;
        if(id>0) ans=max(ans,i+id-1);
    }
    cout<<ans<<endl;
}

int main()
{
    IOS;
    ll t;
    // cin>>t;
    t=1;
    repf(tt,1,t+1) {
        solve(tt);
    }
}     

Measured memory_bytes: 6756
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
int main()
{
    LL a[3],k;
    cin>>a[0]>>a[1]>>a[2]>>k;
    sort(a,a+3);
    LL ans=a[2];
    for(int i=0;i<k;i++){
        ans*=2;
    }
    ans+=a[0]+a[1];
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

sys.setrecursionlimit(10 ** 7)

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

from collections import Counter

s = ns()
c = Counter(s)

ans = inf
for i in c.keys():
    ns = i + s + i
    j = 1
    cur = 0
    res = 0
    while j < len(ns):
        if ns[j] == i:
            res = max(res, j - cur - 1)
            cur = j
        j += 1
    ans = min(ans, res)

print(ans)

Measured memory_bytes: 3316
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define LL long long
#define INF 1<<31-1
#define LNF 9223372036854775807
#define PI 3.14159265358979
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
//#define MOD 998244353
#define NUM 100005

void swap(int* a,int* b){int tmp=*a;*a=*b;*b=tmp;}
int abs(int a){if(a<0)return -a;return a;}
int dup(int a,int d){if(a%d==0)return a/d;else return a/d+1;}
int mod(int a,int m){if(a<0)return a%m+m;else return a%m;}
int GCD(int a,int b){int c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
int LCM(int a,int b){return a*b/GCD(a,b);}
int POW(int a,int n){LL ans=1;while(n>0){if(n&1)ans=ans*a%MOD;a=a*a%MOD;n>>=1;}return (int)ans;}
int icmp(const void* a,const void* b){return *(int*)a-*(int*)b;}
int lcmp(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return 1;if(*(LL*)a<*(LL*)b)return -1;return 0;}
int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;}
int scmp(const void* a,const void* b){return strcmp(*(char**)a,*(char**)b);}
LL fac[NUM],finv[NUM],inv[NUM];
void comi(){int i;fac[0]=fac[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,NUM){fac[i]=fac[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}}
int com(int n,int k){if(n<k||n<0||k<0)return 0;return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;}

int main(){
  int A,B,i,ans=0;
  scanf("%d%d",&A,&B);

  printf("%d\n",6-A-B);
	return 0;
}


Measured memory_bytes: 128
#include<iostream>
using namespace std;
int main(){
    long int N,Y,M,D,sum=0,mil;
    mil = 196471;
    cin >> N;
    while(N--){
        sum = 0;
        cin >> Y >> M >> D;
        for(int i=1;i<Y;i++){
            if(i%3==0)  sum+=200;
            else sum+=195;
        }
        for(int i=1;i<M;i++){
            if(Y%3==0){
                sum+=20;
            }
            else{
                if(i%2==0) sum+=19;
                else sum+=20;
            }
        }
        sum+=D;
        cout << mil-sum << "\n";
    }
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll mod = 1000000007;

const ll LINF = 1e13;
const ll LLINF = 1e18;
const ll ALPHABET = 26;

template <class T>
void Swap(T& r, T& l) {
  T tmp = r;
  r = l;
  l = tmp;
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x; //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいい
  return is;
}


int main() {
  string s;
  ll x, y;
  cin >> s;
  cin >> x >> y;

  vector<ll> xn;
  vector<ll> yn;

  bool isxmove = true;
  bool isfirst = true;
  ll fpos = 0;

  ll count = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == 'F') {
      count++;
    }
    if (s[i] == 'T') {
      if (isxmove) {
        if (isfirst) {
          fpos = count;
          isfirst = false;
        } else {
          xn.push_back(count);
        }
      } else {
        yn.push_back(count);
      }
      count = 0;
      isxmove = !isxmove;
    }
  }

  if (isxmove) {
    if (isfirst) {
      fpos = count;
      isfirst = false;
    } else {
      xn.push_back(count);
    }
  } else {
    yn.push_back(count);
  }


  // cerr << " xn  ";
  // for (auto v : xn) {
  //   cerr << v << ",";
  // } cerr << endl;
  // cerr << " yn  ";
  // for (auto v : yn) {
  //   cerr << v << ",";
  // } cerr << endl;

  // cerr <<endl;

  bool ans = true;

  vector<ll> xd(40000, -1);
  vector<ll> yd(40000, -1);

  ll haba = 9000;

  ll fpoint = 20000;
  ll point = fpoint;
  point += fpos;
  xd[point] = 0;
  for (int i = 0; i < xn.size(); i++) { //最大2000回
    cerr << xn[i]<<endl;
    for (int j = point - haba; j < point + haba; j++) {
      if (xd[j - xn[i]] == i) {
        xd[j] = i + 1;
      }
      if (xd[j + xn[i]] == i) {
        xd[j] = i + 1;
      }
    }
  }
  if (xd[fpoint + x] != xn.size())ans = false;


  // cerr << " xd  ";
  // for (int j = fpoint - 8; j < fpoint + 8; j++) {
  //   cerr << xd[j] << ",";
  // } cerr << endl;


  yd[fpoint] = 0;
  for (int i = 0; i < yn.size(); i++) { //最大2000回
    for (int j = fpoint - haba; j < fpoint + haba; j++) {
      if (yd[j - yn[i]] == i) {
        yd[j] = i + 1;
      }
      if (yd[j + yn[i]] == i) {
        yd[j] = i + 1;
      }
    }
  }
  if (yd[fpoint + y] != yn.size())ans = false;




  cout << (ans ? "Yes" : "No") ;

}




















Measured memory_bytes: 1024
#include <cstdio>
#include <algorithm>

using namespace std;

const int maxn = 1e5 + 10;

int A[maxn];

long long gcd(long long a, long long b)
{
	return b ? gcd(b, a % b) : a;
}

int N;
long long sum;

bool solve()
{
	sum = 0;
	for (int i = 0; i < N; ++i)
		sum += A[i];
	int id = -1;
	for (int i = 0; i < N; ++i)
	{
		if (A[i] & 1)
		{
			if (id == -1)
				id = i;
			else
				return false;
		}
	}
	if (id == -1)
		return false;
	if (A[id] == 1)
		return false;
	--A[id];
	long long g = 0;
	for (int i = 0; i < N; ++i)
		g = gcd(g, A[i]);
	for (int i = 0; i < N; ++i)
		A[i] /= g;
	sum = 0;
	for (int i = 0; i < N; ++i)
		sum += A[i];
	if (~sum & 1)
		return false;
	return !solve();
}

int main()
{
	scanf("%d", &N);
	for (int i = 0; i < N; ++i)
		scanf("%d", &A[i]), sum += A[i];
	if (N & 1)
	{
		if (~sum & 1)
			puts("First");
		else
			puts(solve() ? "First" : "Second");
	}
	else
		puts((sum - N) & 1 ? "First" : "Second");
	return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>

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

using namespace std;

bool fact(int n){
	int k = sqrt(n);
	if(n % 2 ==0) return false;
	else{
		for(int i = 3; i <= k; i = i+2){
			if(n % i == 0) return false;
		}
		return true;
	}
	return 0;
}

void factorize(int n){
	vector<int> fac;
	cout << n <<": ";
	if(fact(n) == true){
		cout << n << endl;
		return;
	}
	while(n % 2 ==0){
		n /= 2;
		fac.push_back(2);
	}

	if(n !=1){
		/*
		//int k = sqrt(n);
		for(int i=3; i<=n/2; i = i+2){
			if(n % i == 0){
				n /= i;
				//cout << i << " ";
				fac.push_back(i);
				i -= 2;
			}
		}*/
		int i=3;
		while(n>1){
			if(n % i == 0){n /= i; fac.push_back(i);}
			else {i = i+2;}
		}
	}

	//cout << endl;
	int m = fac.size();
	for(int i=0; i<m-1; i++){
		cout << fac[i] << " ";
	}
	cout << fac[m-1] << endl;
}
int main(){
	int n;
	cin >> n;
	factorize(n);
	//cout << fact(n) << endl;

	return 0;
}

Measured memory_bytes: 1220
#include <iostream>
#include <tuple>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <bitset>
#include <cassert>
#include <cstdio>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>

#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 forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

const double PI = atan2(0, -1);
const int maxn = 210000;
int dp[maxn];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(20);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "rt", stdin);
#endif

    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int n;
    cin >> n;
    vector<pii> p(n);
    forn(i, n) cin >> p[i].fi >> p[i].se;
    if (x1 > x2) {
        x1 = -x1;
        x2 = -x2;
        for (pii &w: p) w.fi *= -1;
    }
    if (y1 > y2) {
        y1 = -y1;
        y2 = -y2;
        for (pii &w: p) w.se *= -1;
    }

    vector<pii> q;
    for (pii w: p) {
        if (x1 <= w.fi && w.fi <= x2 && y1 <= w.se && w.se <= y2) q.pb(w);
    }

    double ans = 0.0;
    vi ys;
    for (auto w: q) ys.pb(w.se);
    sort(all(ys));
    ys.erase(unique(all(ys)), ys.end());
    sort(all(q));
    forn(i, n + 1) dp[i] = 1e9;
    dp[0] = -1e9;

    int res = 0;
    for (auto w: q) {
        int x = lower_bound(all(ys), w.se) - ys.begin();
        int v = lower_bound(dp, dp + n + 1, x) - dp;
        uax(res, v);
        uin(dp[v], x);
    }
    ans = 1e2 * (x2 + y2 - x1 - y1) - res * (20 - 5 * PI);
    if (res == min(y2 - y1, x2 - x1) + 1) ans += 5 * PI;
    cout << ans << '\n';

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}


Measured memory_bytes: 6000
#include <iostream>
#include <vector>
#include <map>
using namespace std; using P=pair<int,int>; using ll=long long;
const int mx=1e5; vector<vector<int>> v(mx); vector<int> c(mx); int n; bool noco=false;
void dfs(int from, int to, int color) {
	if (from == -1) for(int i=0;i<n;i++) c[i]=-1;
	if (c[to] == 0 || c[to] == 1) {
		if (c[to] != color) noco=true; return;
	} else c[to]=color;
	for(int next:v[to]) {
		if (from == next) continue;
		dfs(to, next, color^1);
	}
}
int main() {
	int m; cin>>n>>m;
	for(int i=0;i<m;i++) {
		int a,b; cin>>a>>b; a--; b--; v[a].push_back(b); v[b].push_back(a);
	}
	dfs(-1,0,0);
	ll w=0,h=0,used=0;
	for(int i=0;i<n;i++) {
		if (c[i] == 0) w++;
		if (c[i] == 1) h++;
	}
	if (noco) {
		for(int i=0;i<n;i++) {
			if (c[i] == -1) continue;
			used+=v[i].size();
		}
		used/=2;
		cout<<(w+h)*(w+h-1)/2-used<<endl;
	} else {
		for(int i=0;i<n;i++) {
			if (c[i] == -1) continue;
			for(int x:v[i]) {
				if (c[i]^1 == c[x]) used++;
			}
		}
		used/=2;
		cout<<w*h-used<<endl;
	}
}

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

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

fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

use std::cmp::min;

fn main() {
    let n: usize = read();
    let b: Vec<u32> = read_vec();
    let mut ans = b[0] + b[n - 2];
    for i in 0..(n - 2) {
        ans += min(b[i], b[i + 1]);
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include "bits/stdc++.h"
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define mFOR(i, a, b) for (int i = a; i > b; i--)
#define MP make_pair
#define PB push_back
#define N 1007
#define INF 1000000007
using namespace std;

typedef long long ll;

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

int main()
{
   int n, t, a, h[N] = {};
   cin >> n >> t >> a;
   FOR(i, 1, n + 1)
   cin >> h[i];

   int res = 1;
   FOR(i, 1, n + 1)
   {
      if (abs(t - h[res] * 0.006 - a) > abs(t - h[i] * 0.006 - a))
         res = i;
   }
   cout << res << endl;
   return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <climits>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
using namespace std;
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define fi first
#define se second
#define ii pair<int, int>
#define ll long long
#define endl "\n"
#define mod 1000000007ll

ll tong(int l, int r) {
	ll ans = (r + l);
	ans *= (r - l + 1);
	return (ans / 2) % mod;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	//freopen("Test.inp", "r", stdin);
	//freopen("Test.out", "w", stdout);
	int n, k;
	cin >> n >> k;
	ll ans = 0;
	rep(i, k, n + 1) {
		ans += tong(n - i + 1, n) - tong(0, i - 1) + 1 + mod;
		ans %= mod;
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 3652
q=list(map(int,input().split()))
X=q[0]
Y=q[1]
A=q[2]
B=q[3]
C=q[4]
r=list(map(int,input().split()))
g=list(map(int,input().split()))
n=list(map(int,input().split()))
r=sorted(r,reverse=True)
g=sorted(g,reverse=True)
n=sorted(n,reverse=True)
A=[]
for i in range(X):
    A.append(r[i])
for i in range(Y):
    A.append(g[i])
A=sorted(A,reverse=True)
s=0
for i in range(min(len(A),len(n))):
    if A[-1]>=n[i]:
        s=i
        break
    A.pop(-1)
    s=i+1
for i in range(s):
    A.append(n[i])
print(sum(A))






Measured memory_bytes: 114768