akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define all(ppp) ppp.begin(),ppp.end()
#define out(ppp) cout<<(ppp)<<endl
#define out1(ppp) cout<<(ppp) 
#define MAX_CHAR 256

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define pb push_back

typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
typedef vector<vpi> vvpi;

typedef set<pi> spi;

const int INF=INT_MAX;

vvi g;
int N;
void swap(ll &a,ll &b){
    ll temp=a;
    a=b;
    b=temp;
}
ll gcd(ll a,ll b){
    while(b){
        a%=b;
        swap(a,b);
    }
    return a;
}

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


vector<int> bfs(int s){
    vector<int> distance(N+1,INT_MAX);
    distance[s]=0;
    queue<int> q;
    q.push(s);
    while(!q.empty()){
        int temp=q.front();
        q.pop();
        for(int i=0;i<g[temp].size();i++){
            if(distance[g[temp][i]]==INT_MAX){
                q.push(g[temp][i]);
                distance[g[temp][i]]=distance[temp]+1;
            }
        }
    }
    ///FOR(i,1,N+1){
    //    out(distance[i]);
    //}
    return distance;
}






int main(){
    int u,v;
    cin>>N>>u>>v;
    --u;
    --v;
    g.resize(N);
    for(int i=1;i<N;i++){
        int x,y;
        cin>>x>>y;
        --x;
        --y;
        g[x].push_back(y);
        g[y].push_back(x);
    }
    vi o1(N);
    o1=bfs(u);
    vi o2(N);
    o2=bfs(v);
    int ans=0;
    for(int i=0;i<N;i++){
        if(o2[i]>o1[i]){
            ans=max(ans,o2[i]);
        }
    }
    out(ans-1);
    return 0;
}


Measured memory_bytes: 7032
#include <iostream>
#include <vector>
#include <unordered_set>
#include <algorithm>
#include <cmath>

using namespace std;

template <int base>
int digit_sum(int n)
{
	int sum = 0;
	while (n > 0) {
		sum += n % base;
		n /= base;
	}
	return sum;
}

using ivec = vector<int>;

ivec read_int_args()
{
	int N;
	cin >> N;
	ivec v(N);
	for (auto& e : v) {
		cin >> e;
	}
	return v;
}

int compar(const void * b, const void* a)
{
	return (*(int*)a - *(int*)b );
}

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

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

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

bool func(long long &A, long long d)
{
	
	if ((A % d)) {
		return false;
	}
	A /= d;
	while (!(A % d)) {
		A /= d;
	}
//	cout << "T" << d << endl;
	return true;
}

bool isprim(long long A)
{
	if (A == 1) return false;
	float sq = sqrt(A);
	long long n = 7;
	while (n < sq) {
		if (!(A % n))
			return false;
		n += 2;
	}
	return true;
}

int main()
{
	int N;
	cin >> N;
	
	if (N < 3) {
		cout << "0" << endl;
		return 0;
	}
	
	vector<long> L(N);
	for (int i = 0; i < N; i++) {
		cin >> L[i];
	}

	sort(L.begin(), L.end(), greater<long>());
	
	int cnt = 0;
	for (int i = 0; i < N - 2; i++) {
		for (int j = i + 1; j < N - 1; j++) {
			for (int k = j + 1; k < N; k++) {
				if (L[i] == L[j] || L[j] == L[k])
					continue;
				
				if (L[i] >= L[j] + L[k]) continue;
				cnt++;
			}
		}
	}
	cout << cnt << endl;

	return 0;
}


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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
typedef long long ll;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}

int main() {
    int N; cin >> N;
    vector<double> v(N);
    rep(i, N) cin >> v[i];
    rep(i, N-1) {
        sort(all(v), greater<double>());
        double nv = (v[v.size()-1] + v[v.size()-2]) / 2.0;
        v.pop_back();
        v.pop_back();
        v.pb(nv);
        
    }
    printf("%.16f\n", v[0]);
}

Measured memory_bytes: 256
#include<stdio.h>

void insertionSort(int A[],int N){
    int i,v,j;
    for(i=1;i<N;i++){
        v=A[i];
        j=i-1;
        while(j>=0&&A[j]>v){
            A[j+1] = A[j];
            j--;
        }
        A[j+1]=v;
        for(j=0;j<N-1;j++){
           printf("%d ",A[j]);
        }
    printf("%d\n",A[N-1]);
    }
}

int main(void){
    int A[1000],N,i;
    scanf("%d",&N);
    for(i=0;i<N;i++){
        scanf("%d",&A[i]);
    }
    for(i=0;i<N-1;i++){
           printf("%d ",A[i]);
    }
    printf("%d\n",A[N-1]);
    insertionSort(A, N);
}


Measured memory_bytes: 2100
#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

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

  int cnt1 = 0;
  int cnt2 = 0;
  int cnt3 = 0;
  for (int i = 0; i < N; i++) {
    int P;
    cin >> P;
    if (P <= A) {
      // cout << 1 << endl;
      cnt1++;
    } else if(A + 1 <= P && P <= B) {
      // cout << 2 << endl;
      cnt2++;
    } else {
      // cout << 3 << endl;
      cnt3++;
    }
  }

  int answer = min(cnt1, min(cnt2, cnt3));

  cout << answer << endl;

}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll X,K,D; cin >> X >> K >> D;
    
    X = abs(X);
    
    ll cnt = X/D;
    
    if(cnt > K){
        X -= D*K;
        res = abs(X);
    }else{
        X -= D*cnt;
        
        K -= cnt;
        if(K%2 == 0){
            res = abs(X);
        }else{
            res = abs(X-D);
        }
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
 
int main(){
  int N, K, A[200010]={0};
  cin >> N >> K;
  int A_tmp;
  for (int i=0;i<N;i++){
    cin >> A_tmp;
    A[A_tmp-1]++;
  }
  sort(A, A+N, greater<int>());
  
  int64_t retval = 0;
  for (int i=K;i<N;i++){
    if (A[i]==0) break;
    retval += A[i];
  }
  cout << retval << endl;
}
 

Measured memory_bytes: 1024
#include <chrono>

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <time.h>
#include <random>
#include <string>
#include <cassert>
#include <vector>
#include <ostream>
#include <istream>
#include <stack>
#include <deque>
#include <queue>
#include <functional>

using namespace std;

#define int long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define pii pair<int, int>
#define ld long double

ostream& operator << (ostream &a, const vector<int> &b) {
    for (auto k : b) cout << k << " ";
    return a;
}

#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << (x) << "\n";
    const int INF = 1e18;
//    const int mod = 2600000069;
//    const int p = 10;
//    const ld PI = 3.1415926535;
#else
    #define dbg(x)
    const int INF = 1e18;
//    const int mod = 2600000069;
//    const int p = 179;
//    const ld PI = 3.1415926535;
#endif

//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,sse3,sse4")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("fast-math")
//#pragma GCC target("avx2")
//#pragma GCC optimize("section-anchors")
//#pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
//#pragma GCC optimize("vpt")
//#pragma GCC optimize("rename-registers")
//#pragma GCC optimize("move-loop-invariants")
//#pragma GCC optimize("unswitch-loops")
//#pragma GCC optimize("function-sections")
//#pragma GCC optimize("data-sections")

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef LOCAL
    #else
//        freopen("capitals.in", "r", stdin);
//        freopen("capitals.out", "w", stdout);
    #endif
    int k, n;
    cin >> k >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    int ans = 0;
    for (int i = 1; i < n; i++) {
        ans = max(ans, a[i] - a[i - 1]);
    }
    ans = max(ans, k - a[n - 1] + a[0]);
    cout << k - ans;
}
/*

*/


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

int main()
{
  int n;
  cin >> n;
  vector<int> d(n);
  int i;
  for(i = 0; i < n; i++)
  {
    cin >> d.at(i);
  }
  sort(d.begin(), d.end());
  cout << d.at(n/2)-d.at(n/2-1) << endl;
}


Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    public static bool f = false, t = true;
    static void Main(string[] args)
    {
        string a = Read.Str();
        for (int i = 0; i < a.Length; i++)
        {
            if (i == 0) { continue; }
            string n = a.Substring(0, a.Length - i);
            if (n.Length % 2 == 0)
            {
                if (n.Substring(0, n.Length / 2) == n.Substring(n.Length / 2)) { Console.WriteLine(n.Length); break; }
               
            }
        }Console.ReadLine();

    }

    public static long gcd(long a, long b)
    {
        while (true)
        {
            if (a == 0) { return b; }
            if (b == 0) { return a; }
            if (a > b) { a -= b; }
            else { b -= a; }
        }
    }
    public static long lcm(long a, long b)
    {
        return a * b / gcd(a, b);
    }
    public static bool IsPrime(long n)
    {
        if (n < 2) return false;
        if (n == 2) return true;

        for (long i = 2; i < n; i++)
        {
            if (n % i == 0) return false;
        }
        return true;
    }

}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static long Long()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] longs()
    {
        return Console.ReadLine().Split().Select(long.Parse).ToArray();
    }
    public static int Int()
    {
        return int.Parse(Console.ReadLine());
    }
    public static int[] ints()
    {
        return Console.ReadLine().Split().Select(int.Parse).ToArray();
    }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

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

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
const int INF = int (1e9) + int (1e5);
const ll INFL = ll(2e18) + ll(1e10);
const ui MOD = 1E9 + 7;
const double EPS = 1e-9;
#define FOR(i,n) for (int i=0;i<(n);++i)
#define ROF(i,x) for(int i = (x) ; i >= 0 ; --i)
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define ODD(x) ( ((x)&1)==0?0:1 )
#define SIGN(x) ( ((x) > 0) - ((x) < 0)  )
#define dbg(x) cerr << #x"= " << x << endl

std::mt19937_64  generator(std::chrono::system_clock::now().time_since_epoch().count());

inline ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a, ll b) { return a ? gcd(b%a, a): b; }
ll lcm(ll a, ll b) { return a / gcd(a,b) * b; }


void READ(bool _local){
    ios_base::sync_with_stdio(false); cin.tie(0);
#ifdef _DEBUG
    if (_local)
        freopen ("in.txt", "r", stdin);
#endif
}


int main() {
    READ(0);
    int n,m,q;cin>>n>>m>>q;
    vvi a(q,vi(4));
    FOR(i,q) {
        FOR(j,4) cin>>a[i][j];
        --a[i][0];--a[i][1];
    }

    int mx=0;
    vi v(n);
    v[0]=1;
    function<void(int)> doit = [&](int idx){
        if (idx==n){
            int este=0;
            for(int i=0;i<q;++i){
                if (v[a[i][1]] - v[a[i][0]] == a[i][2])
                    este += a[i][3];
            }
            mx=max(mx,este);
            return;
        }
        for(v[idx] = v[idx-1];v[idx]<=m;++v[idx]){
            doit(idx+1);
        }
    };
    doit(1);
    cout << mx;

    return 0;
}

Measured memory_bytes: 3624
#include<stdio.h>

int main()

{
    int n, rev=0;

    scanf("%d", &n);

    int temp=n;

    while(n>0){

        rev = (rev*10)+(n%10);

        n = n/10;
    }

    if(rev==temp) printf("Yes\n");
    else printf("No\n");

    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph= vector<vector<int>>; 
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
// ミント
const int mod = 1000000007;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
//昆布
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
}   ;


int main(){
  ll n, k;cin>>n >>k;
  vector<ll> A(n) ;rep(i,n) cin>>A[i] ;
  sort(A.begin(),A.end()) ;
  mint ans=0 ;
  combination c(n+5) ;
  rep(i,n-k+1){
   mint x=A[n-1-i]-A[i] ;
   ans+= x*c(n-1-i,k-1) ;
  }
  cout<<ans<<endl ;
    return 0;
  }

Measured memory_bytes: 2560
#include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    double r,pi=3.141592653589;
    cin >> r ;
    cout << fixed << setprecision(5) << r*r*pi ;
    cout <<" ";
    cout << fixed << setprecision(5) << r*2*pi << endl;
}


Measured memory_bytes: 3228
a=int(input())
b=int(input())
c=int(input())
d=int(input())
if a<=b and c<=d:
  print(a+c)
elif a<=b and c>=d:
  print(a+d)
elif a>=b and c<=d:
  print(b+c)
else:
  print(b+d)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const int maxn = 1e6 + 5 ;
const ll mod = 1e9 + 7 ;
int n ;
ll a[maxn] ;
ll qpow(ll a , ll b)
{
    ll ans = 1 ; 
    while(b)
    {
        if(b & 1)
          ans = (ans * a) % mod ;
        b >>= 1 ;
        a = (a * a) % mod ;
    }
    return ans  ;
}
ll inv(ll x)
{
	return  qpow(x , mod - 2) ;
}
int cnt = 0 ;
bool vis[maxn] ;
int prime[maxn] ;
int num[maxn] ;
void get_prime()
{
	memset(vis , 0 , sizeof(vis)) ;
	vis[1] = 1 ;
    for(int i = 2 ; i <= 1e6 ; i ++)
	{
        if(!vis[i]) 
		   prime[++ cnt] = i ;
        for(int j = 1 ; j <= cnt && i * prime[j] <= 1e6 ; j ++)
		{
            vis[i * prime[j]] = 1 ;
            if(i % prime[j] == 0) break ;
        }
    }
}
void solve(ll x)
{
	for(int i = 1 ; prime[i] * prime[i] <= x ; i ++)
	{
		int temp = 0 ;
		if(x % prime[i] != 0)  continue ;
		while(x % prime[i] == 0)  x /= prime[i] , temp ++ ;
		num[prime[i]] = max(num[prime[i]] , temp) ;
	}
	if(x > 1)  num[x] = max(num[x] , 1) ;
}
ll cal()
{
	get_prime() ;
	for(int i = 1 ; i <= n ; i ++)
	  solve(a[i]) ;
	ll lcm = 1 ;
	for(int i = 1 ; i <= 1e6 ; i ++)
	  if(!vis[i])
	    lcm *= qpow(i , num[i]) , lcm %= mod ;
	return lcm ;
}
int main()
{
	ios::sync_with_stdio(false) ;
    cin.tie(0) ;
    ll lcm , ans = 0 ;
    cin >> n ;
    for(int i = 1 ; i <= n ; i ++)  cin >> a[i] ;
    lcm = cal() ;
    for(int i = 1 ; i <= n ; i ++)
      ans += lcm % mod * inv(a[i]) , ans %= mod ;
    cout << ans << '\n' ;
    return 0 ;
}


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

int main(){
  int h, w;
  cin >> h >> w;
  vector<vector<char>> image(h, vector<char>(w));
  rep(i, h)rep(j,w){
    cin >> image[i][j];
  }
  rep(i,h){
    rep(j,2){
      rep(k,w){
        cout << image[i][k];
      }
      cout << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
long f(long x){
    if(x <= 1){
        return 1;
    }else{
        return 1 + 2 * f(x / 2);
    }
}
int main(void){
    long a;
    cin >> a;
    cout << f(a) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#define travel(x, i) for (int i = fir[x]; i; i = e[i].nxt)
#define rep(i, x, y) for (int i = (x); i <= (y); i ++)
using namespace std;

typedef long long LL;
const int N = 1e5 + 10;

struct edge {
  int nxt, to;
} e[N << 1];
int fir[N], cnt = 0;
int n, m, w[N], sum[N];

inline void addedge(int x, int y) {
  e[++ cnt] = (edge){fir[x], y};
  fir[x] = cnt;
}

namespace Tree {
  inline void Dfs(int x, int f) {
    if (x == 1) w[x] = 1;
    else w[x] = - w[f];
    sum[x] = w[x];
    travel(x, i)
      if (e[i].to != f) {
	Dfs(e[i].to, x);
	sum[x] += sum[e[i].to];
      }
  }
  inline void solve() {
    LL ans = 0;
    Dfs(1, 0);
    if (sum[1]) return (void) puts("-1");
    rep(i, 1, n) ans += abs(sum[i]);
    printf("%lld\n", ans);
  }
}

namespace Ring {
  bool vis[N], odd;
  int fa[N], num[N], u, v;
  
  inline void Dfs(int x, int f) {
    fa[x] = f;
    vis[x] = 1;
    if (x == 1) w[x] = 1;
    else w[x] = - w[f];
    sum[x] = w[x];
    travel(x, i)
      if (e[i].to != f) {
	if (!vis[e[i].to]) {
	  Dfs(e[i].to, x);
	  sum[x] += sum[e[i].to];
	}
	else {
	  u = x; v = e[i].to;
	  if (w[x] == w[e[i].to]) odd = 1;
	}
      }
  }
  inline void solve() {
    LL ans = 0;
    Dfs(1, 0);
    if (odd) {
      if (sum[1] & 1) return (void) puts("-1");
      int t = - (sum[1] >> 1);
      ans += abs(t);
      for (int i = u; i; i = fa[i]) sum[i] += t;
      for (int i = v; i; i = fa[i]) sum[i] += t;
      rep(i, 1, n) ans += abs(sum[i]);
      printf("%lld\n", ans);
    }
    else {
      if (sum[1]) return (void) puts("-1");
      memset(w, 0, sizeof w);
      for (int i = u; i; i = fa[i]) w[i] ++;
      for (int i = v; i; i = fa[i]) w[i] --;
      int t = 0, k;
      rep(i, 1, n) {
	if (w[i] == 0) ans += abs(sum[i]);
	else num[++ t] = sum[i] * w[i];
      }
      num[++ t] = 0;
      sort(num + 1, num + t + 1);
      k = num[(t + 1) >> 1];
      rep(i, 1, t) ans += abs(num[i] - k);
      printf("%lld\n", ans);
    }
  }
}

int main() {
  scanf("%d%d", &n, &m);
  int x, y;
  rep(i, 1, m) {
    scanf("%d%d", &x, &y);
    addedge(x, y); addedge(y, x);
  }
  if (m == n - 1) Tree :: solve();
  else Ring :: solve();
  return 0;
}


Measured memory_bytes: 6272
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 999999999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(25) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 510000
#define ALL(a)  a.begin(),a.end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
lli gcd(lli num1, lli num2){
    return num2 != 0 ? gcd(num2, num1 % num2) : num1;
}
lli lcm(lli num1, lli num2){
    return num1 / gcd(num1, num2) * num2;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli A,B,C,D,E,F,N,M,K,L,X,Y,Z,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> W >> H >> X >> Y;
  Out((double)W*H/2);
  if(X==(double)W/2&&Y==(double)H/2)Out(1);
  else Out(0);
}

Measured memory_bytes: 256
import numpy as np

N=int(input())
A=np.array(input().split(),dtype=np.int32)
B=np.array(input().split(),dtype=np.int32)

result=0
for i in range(N):
    if A[i]>B[i] and B[i]!=0:
        result+=B[i]
        A[i]=A[i]-B[i]
        B[i]=0
    else:
        result+=A[i]
        B[i]=B[i]-A[i]
        A[i]=0
        if A[i+1]>B[i]:
            result+=B[i]
            A[i+1]=A[i+1]-B[i]
            B[i]=0
        else:
            result+=A[i+1]
            B[i]=B[i]-A[i+1]
            A[i+1]=0

print(result)

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2017/09/19  Problem: ACPC2017_day2_d  / Link:   ----- */
/* ------??????------



-----?????????????????§----- */
/* -----?§£??¬???-----



----?§£??¬???????????§---- */

LL N;

LL ans = 0LL;
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);

	cin >> N;
	VI a(1);
	cin >> a[0];
	int t;
	FOR(i, 1, N) {
		cin >> t;
		if (a.back() != t)a.push_back(t);

	}
	N = a.size();
	if (N == 1) {
		cout << 1 << endl;
		return 0;
	}

	int cnt = 2;
	int num;
	int M = 2;
	int to = 0;
	if (a[0] < a[1])to = 1;
	//debug(N);
	FOR(i, 1, N-1) {
		if (to==1&&a[i] < a[i + 1]||to==0&&a[i]>a[i+1]) {
			cnt++;
			M = max(M, cnt);
		}
		else {
			cnt = 2;
			to ^= 1;
		}
	}

	cout << M << "\n";

	return 0;
}

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

int main(){
  long long int h,w;
  cin>>h>>w;
  vector<vector<long long int> > c(10,vector<long long int>(10));
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      cin>>c[i][j];
    }
  }

  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      for(int k=0;k<10;k++){
        c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
      }
    }
  }
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      for(int k=0;k<10;k++){
        c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
      }
    }
  }
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      for(int k=0;k<10;k++){
        c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
      }
    }
  }

  long long int ans=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      int a;
      cin>>a;
      if(a!=-1){
        ans+=c[a][1];
      }
    }
  }

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
program prob6
    implicit none
    integer::n, i, p
    integer, allocatable::c(:)
    read(*,*) n
    allocate(c(0:n))
    c = 0
    do i = 1, n
        read(*,*) p
        if(c(p) == 0 .and. c(p-1) == 0) then
            c(p) = 1
        else if(c(p) == 0) then
            c(p) = c(p-1) + 1
        end if
    end do
    write(*,*) n - maxval(c)
    deallocate(c)
    stop
end program

Measured memory_bytes: 3276
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int main(){
	REP(i,9){
	    REP(j,9){
	        cout<<i+1<<"x"<<j+1<<"="<<(i+1)*(j+1)<<endl;
	    }
	}
	return(0);
}

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

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

    ll s;
    cin >> s;

    ll a = sqrt(s);
    while (a * a < s)
        a++;

    s = a * a - s;

    cout << 0 << ' ' << 0 << ' ' << a << ' ' << 1 << ' ' << s << ' ' << a
         << endl;

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;

class Program
{
	//Main
	static void Main(string[] args)
	{
		//読み込む
		long[] XYABC = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
		long X = XYABC[0];
		long Y = XYABC[1];
		long A = XYABC[2];
		long B = XYABC[3];
		long C = XYABC[4];

		long[] pn = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
		long[] qn = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
		long[] rn = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();

		//配列をソート
		Array.Sort(pn);
		Array.Sort(qn);
		Array.Sort(rn);

		//対象たり得るりんごを格納するリスト
		List<long> appleList = new List<long>();

		//pnのうち、上からX個をappleListに加える
		for(long i=0; i<X; i++){
				appleList.Add(pn[A-i-1]);
		}
		//qnのうち、上からY個をappleListに加える
		for(long i=0; i<Y; i++){
				appleList.Add(qn[B-i-1]);
		}
		//rnを全てappleListに加える
		for(long i=0; i<C; i++){
				appleList.Add(rn[i]);
		}

		//リストを降順にソート
		appleList.Sort();
		appleList.Reverse();

		/*debug
		foreach(long i in appleList){
				Console.Write(i + " ");
		}
		*/

		//大きい方からX+Y個食べていく
		long answer = 0;
		
		for(int i=0; i<X+Y; i++){
				answer += appleList[i];
		}

		Console.WriteLine(answer);
	}
}



Measured memory_bytes: 45632
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i< (n);i++)
#define rep1(i,n) for(int i=1;i<= (n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

const static ll MOD = (1e+9)+7;

int main(){
    int n;cin>>n;
    map<int,int> cnt;
    rep1(i,n-1){
        int tmp;cin>>tmp;
        cnt[tmp]++;
    }
    rep1(i,n){
        cout<<cnt[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 13000
#include <iostream>
#include <vector>
#include <algorithm>
#define int long long
using namespace std;

signed main() {
    int N;
    cin >> N;
    vector<int> A(N + 2, 0);
    for (int i = 1; i <= N; ++i) cin >> A[i];
    
    vector<int> B, C;
    for (int i = 1; i <= N; ++i) {
        if (A[i - 1] == 0 && A[i] != 0) B.push_back(i);
        if (A[i + 1] == 0 && A[i] != 0) C.push_back(i);
    }
    
    int sum = 0;
    for (int i = 0; i < B.size(); ++i) {
        int cnt = 0;
        for (int j = B[i]; j <= C[i]; ++j) cnt += A[j];
        sum += cnt / 2;
    }
    cout << sum << endl;
    return 0;
}


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

#include <algorithm>

using namespace std;

#define sqr(x) ((x) * (x))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

typedef long long ll;

const int MOD = 1000000007;
const int INF = 1000000007;
const ll INFLL = 1000000000000000007LL;

void solve() {
  int N;
  cin >> N;
  string ans = "No";
  for (int i = 1; i < 10; i++) {
    for (int j = 1; j < 10; j++) {
      if (i * j == N) {
        ans = "Yes";
      }
    }
  }
  cout << ans << endl;
}

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

  solve();

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define ALL(x) (x).begin(),(x).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
using namespace std;
typedef long long ll;

int H,W,h,w;

int main()
{
  cin >> H >> W >> h >> w;
  int res = (H - h) * (W - w);
  cout << res << endl;;

  return 0;
}


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

using namespace std;

int main(void)
{
    int N;
    cin >> N;
    vector<long long> A(N);
    for(long long& a: A){
        cin >> a;
    }

    unsigned long long total = 0;
    
    for(int i = 1; i < N; i++){
        if(A[i-1] > A[i]){
            total += (A[i-1] - A[i]);
            A[i] = A[i-1];
        }
    }
    cout << total << endl;

    return 0;
}

Measured memory_bytes: 4836
n=int(input())
h=list(map(int,input().split()))
dp=[0]*(n+1)
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(2,n):
  dp[i]=min(dp[i-2]+abs(h[i]-h[i-2]),dp[i-1]+abs(h[i]-h[i-1]))
  # print(dp)
print(dp[-2])


Measured memory_bytes: 20572
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll gcd(int a,int b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(int a,int b){return a*b/gcd(a,b);}
const int INF=1e9;
const ll INFS=1e18;
const int MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);

int main() {
  int n;
  string s;
  cin>>n>>s;
  int ans=1;
  for(int i=1;i<len(s);i++){
    if(s[i]!=s[i-1]) ans++;
  }
  cout<<ans<<endl;
}

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

#define rep(i,n) for(int i = 0; i < n; i++)
#define REP(i,n) for(int i = 1; i < n; i++)
#define per(i,n) for(int i = n-1; i >= 0; i--)
#define PER(i,n) for(int i = n; i >= 1; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
using vP = vector<P>;
using vPl = vector<Pl>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



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

  int h, w;
  cin >> h >> w;
  vs a(h);
  rep(i,h) cin >> a[i];
  rep(i,h) {
    bool ok = true;
    rep(j,w) if(a[i][j] == '#') ok = false;
    if(ok) rep(j,w) a[i][j] = 'w';
  }
  rep(j,w) {
    bool ok = true;
    rep(i,h) if(a[i][j] == '#') ok = false;
    if(ok) rep(i,h) a[i][j] = 'w';
  }
  rep(i,h) {
    bool ok = false;
    rep(j,w) {
      if(a[i][j] == 'w') continue;
      ok = true;
      cout << a[i][j];
    }
    if(ok) cout << endl;
  }
}

Measured memory_bytes: 256
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();

    let h: usize = iter.next().unwrap().parse().unwrap();
    let a: usize = iter.next().unwrap().parse().unwrap();

    let ans = if h % a == 0 {
        h / a
    } else {
        h / a + 1
    };
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repR(i, n) for(int i = (n) - 1; i > -1; i--)
#define rep1(i, n) for(int i = 1; i < (int)(n + 1); i++)
#define rep1R(i, n) for(int i = (n); i > 0; i--)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

int main() {
  int a, b; cin >> a >> b;
  int ans = 0;
  rep1(i, a) {
    if (i == a && i > b) break;
    ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long n,ans=9999999999;
  cin >> n;
  for(long i=0;i<=n;i++) {
    long a=0;
    for(long j=1;j<=i;j*=6) a+=i/j%6;
    for(long j=1;j<=n-i;j*=9) a+=(n-i)/j%9;
    ans=min(ans,a);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

const int INF = 1001001001;

int main(){
  int n;
  cin >> n;
  vector<vector<pair<int, int>>> gr(n, vector<pair<int, int>>());
  rep(i, n){
    int a;
    cin >> a;
    int k;
    cin >> k;
    rep(j, k){
      int v, c;
      cin >> v >> c;
      gr.at(i).push_back(make_pair(v, c));
    }
  }
  vector<bool> chk(n, false);
  vector<int> d(n, INF);
  priority_queue<pair<int, int>> q;
  q.push(make_pair(0, 0));
  int co = 0;
  while(!q.empty()){
    auto now = q.top(); q.pop();
    if(chk.at(now.second) == true) continue;
    d.at(now.second) = -1 * now.first;
    chk.at(now.second) = true;
    co++;
    if(co == n) break;

    for(auto p : gr.at(now.second)){
      if(chk.at(p.first) == true) continue;
      q.push(make_pair(now.first-p.second, p.first));
    }
  }

  rep(i, n){
    cout << i << " " << d.at(i) << endl;
  }
  return 0;
}


Measured memory_bytes: 9524
#include<stdio.h>
int main(void){
	int i,j;
	int count[101]={0};
	int number;
	int counta=0;
	int flag=0;
	while(scanf("%d",&number)!=EOF){
		counta++;
		count[number]++;
	}
	
	for(i=counta;i>=0;i--){
		for(j=0;j<101;j++){
			if(count[j]==i){
				printf("%d\n",j);
				flag=1;
				break;
			}
		}
		if(flag==1){
			break;
		}
	}
	for(i=0;i<101;i++){
		if((count[i]==count[j])&&(i!=j)){
			printf("%d\n",i);
		}
	}
	return 0;
}

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

int t[10][10],s[10][10],ans[10][10];
int dx[] = {0,-1,0,1,0};
int dy[] = {-1,0,0,0,1};

bool check(int *used){
	memset(ans,0,sizeof(ans));
	memcpy(s,t,sizeof(t));

	for(int i=0;i<10;i++){
		ans[0][i] = used[i];
		if(used[i]){
			for(int j=0;j<5;j++){
				int nx = i + dx[j];
				int ny = dy[j];

				if(nx>=0 && 10>nx && ny>=0 && 10>ny){
					s[ny][nx] = !s[ny][nx];
				}
			}
		}
	}

	for(int i=1;i<10;i++){
		for(int j=0;j<10;j++){
			if(s[i-1][j]){ //ツ湘」ツつェ1ツづ按づァツづ篠必ツつクツ古オツつェツ必ツ要
				ans[i][j] = 1;
				for(int k=0;k<5;k++){
					int nx = j + dx[k];
					int ny = i + dy[k];

					if(nx>=0 && 10>nx && ny>=0 && 10>ny){
						s[ny][nx] = !s[ny][nx];
					}
				}
			}
		}
	}

	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			if(s[i][j]) return false;
		}
	}
	return true;
}

bool solve(int idx,int *used){
	if(idx == 10){
		if(check(used)){
			return true;
		}
		return false;
	}

	if(solve(idx+1,used)) return true;
	used[idx] = 1;
	if(solve(idx+1,used)) return true;
	used[idx] = 0;

	return false;
}

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

	while(n--){
		for(int i=0;i<10;i++){
			for(int j=0;j<10;j++){
				cin>>t[i][j];
			}
		}

		int used[10];
		memset(used,0,sizeof(used));
		solve(0,used);

		for(int i=0;i<10;i++){
			for(int j=0;j<9;j++){
				cout<<ans[i][j]<<" ";
			}
			cout<<ans[i][9]<<endl;
		}
	}

	return 0;
}

Measured memory_bytes: 0
//By Zank100
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define din(t) long long t;cin>>t;
#define in(t) cin>>t;
#define full(t) t.begin(),t.end()
ll mul(ll a, ll b)
{
    return(((a%mod)*(b%mod))%mod);
}
ll modexp(ll b, ll e){
	ll res = 1;
	for(; e; b = b * b % mod, e >>= 1) if(e & 1) res = res * b % mod;
	return res;
}
ll modinv(ll a){
    ll x=mod-2;
	return modexp(a,x);
}
void Inp_Out(){
    #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("alchemy_input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("alchemy_output.txt", "w", stdout);
    #endif
}
unsigned cntBits(unsigned ll number){
      return (ll)log2(number)+1;
}
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	//Inp_Out();
	din(t)
	ll ans;
	if(t>=400&&t<600)ans=8;
	else if(t>=600&&t<800)ans=7;
	else if(t>=800&&t<1000)ans=6;
	else if(t>=1000&&t<1200)ans=5;
	else if(t>=1200&&t<1400)ans=4;
	else if(t>=1400&&t<1600)ans=3;
	else if(t>=1600&&t<1800)ans=2;
	else if(t>=1800&&t<2000)ans=1;
	cout<<ans<<endl;
	/*while(t--){

	}*/
	return 0;
}


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

int ctoi(char c){
		if('0' <= c && c <= '9') return (c-'0');
		else return -1;
}

int main()
{
		int n=0, i, j, m, k, ans;
		string x[10000];
		while (1) {
				cin >> x[n];
				if (x[n]=="0") break;
				n++;
		}
		for (i=0; i<n; i++) {
				ans = 0;
				for (j=0; j<x[i].size(); j++) {
						ans += ctoi(x[i][j]);
				}
				cout << ans << "\n";
		}
}

Measured memory_bytes: 3216
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

int main() {
	//入力
	int N, D, X;
	cin >> N >> D >> X;

	vector<int> A(N);
	for (int i = 0; i < N; i++) cin >> A[i];
	
	int sum=0;

	for (int i = 0; i < N; i++) {
		for (int k = 0;;k++) {
			if (k*A[i] + 1 > D) break;
			sum += 1;
		}
	}

	cout << sum + X << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
	double  x1, y1, x2, y2, x3, y3, x4, y4;
	int n, i;
	double d1, d2;
	scanf("%d", &n);
	for(i=0;i<n;i++)
	{
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
		if(y1 == y2 && y3 == y4) 
		{
			printf("YES\n");
		}
		else
		{
			d1 = (x1 - x2) / (y1 - y2);
			d2 = (x3 - x4) / (y3 - y4);
			if(d1 == d2) printf("YES\n");
			else printf("NO\n");
		}
	}
	return 0;
}

Measured memory_bytes: 620
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<cmath>
using namespace std;

int main(){
    char s[100000+1];
    scanf("%s",s);
    int n = strlen(s), sum0 = 0, sum1 = 0;
    if(n % 2 == 0){
        for(int i = 0; i < n; i++){
            if(s[i] == '1' && i % 2 == 0) sum0++;
            if(s[i] == '1' && i % 2 == 1) sum1++;
        }
        if(sum0 > sum1){
            cout << n/2 - sum0 + sum1 << endl;
        }else{
            cout << n/2 + sum0 - sum1 << endl;
        }
    }else{
        for(int i = 0; i < n; i++){
            if(s[i] == '1' && i % 2 == 0) sum0++;
            if(s[i] == '1' && i % 2 == 1) sum1++;
        }
        if(sum0 <= sum1 ){
            cout << n/2 - sum1 + sum0 <<endl;
        }else{
            cout << n/2 + 1 - sum0 + sum1 << endl;
        }
    }
    return 0;
}

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

bool no[11111111];
int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	ll n;cin >> n;
	ll sum = 0;
	REP(i, n){
		sum += i+1;
		no[i] = true;
		if(sum >= n)break;
	}
	REP(i, n){
		if(sum - (i+1) == n){
			sum -= i+1;
			no[i] = false;
		}
	}
	vector<int> ans;
	REP(i, n)if(no[i])cout << i+1 << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const ll mod=1e9+7;
const ll inf = (ll)1e17;
const ld eps = 1e-12;
const ld PI = 3.14159265358979323846;
ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}



int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll r;
    cin>>r;
    ll res=r*r;
    cout<<res<<endl;
    return 0;
    }


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define imfor(i, n) for(int i = 0; i < n; i++)
using namespace std;
ll MOD = 1000000007;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if ((a * b) % 2 == 0) {
        cout << "No" << endl;
    }
    else {
        cout << "Yes" << endl;
    }
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <tuple>
using namespace std;
#define lli long long int

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,i;
	vector<lli> a;
	vector<lli> b;
	cin>>n;
	a.resize(n+1);
	b.resize(n);
	for(i=0;i<=n;i++)
		cin>>a[i];
	for(i=0;i<n;i++)
		cin>>b[i];
	lli a1 = min(a[0],b[0]);
	lli z = 0;
	lli cur = max(z,b[0]-a[0]);
	for(i=1;i<=n;i++)
	{
		a1 += min(cur,a[i]);
		lli curval = max(z,a[i]-cur);
		if(i<n)
		{
			a1 += min(curval,b[i]);
			cur = max(z,b[i]-curval);
		}
	}
	reverse(a.begin(), a.end());
	reverse(b.begin(), b.end());
	lli a2 = min(a[0],b[0]);
	cur = max(z,b[0]-a[0]);
	for(i=1;i<=n;i++)
	{
		a2 += min(cur,a[i]);
		lli curval = max(z,a[i]-cur);
		if(i<n)
		{
			a2 += min(curval,b[i]);
			cur = max(z,b[i]-curval);
		}
	}
	cout<<max(a1,a2)<<endl;
	return 0;
}

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

int main() {
    int k;
    string s;
    cin >> k >> s;
    if (s.size() <= k) {
        cout << s << endl;
    }
    else{
        string ans = s.substr(0, k);
        ans += "...";
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <cmath>
using ll = long long;
#define rep(i, n) for (ll i = 0; i < (n); i++)
using namespace std;

ll prime(ll n, vector<ll> &s, ll num){
  ll cnt = 0;
  bool flag = false;
  while(n % num == 0){
    flag = true;
    cnt++;
    n /= num;
  }
  if (flag) s.push_back(cnt);
  return n;
}

int main(){
  ll n;
  cin >> n;
  vector<ll> count;
  n = prime(n, count, 2);
  ll ans = 0;
  for(ll i = 3; i <= sqrt(n); i+=2){
    n = prime(n, count, i);
  }
  if (n != 1) count.push_back(1);
  for(ll x : count){
    ll beki = 3;
    x -= 3;
    ans++;
    while(x >= 0){
      ans++;
      x -= beki;
      beki++;
    }
  }
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 3732
#define _CRT_SECURE_NO_WARNINGS

#include <bits/stdc++.h>
#include <random>
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef map<int, int> mii;
typedef pair<int, ii> edge;


#define sc(x)  scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mem(arr,val) memset(arr,val,sizeof arr)
#define sz(v) (int)v.size()
#define rsz(v) v.resize
#define clr(v) v.clear()
#define rev(v) reverse(all(v))
#define lop(i,end) for(int i=0; i<end; i++)
#define rlop(i,start) for(int i=start-1; i>=0; i--)
#define loop(i,start,end) for(int i=start; i<end; i++)
#define rloop(i,start,end) for(int i=start-1; i>=end; i--)
#define PB push_back
#define pb pop_back
#define mP make_pair
#define f first
#define s second

const ll OO = (ll)(4e18) + 9;
const int MOD = (int)(1e9) + 7;
const int oo = 2147483647;
const double EPS = 1e-8;
const double PI = acos(-1.0);

//enum dir { D, R, U, L , dr, ur, dl, ul };
int dx[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dy[] = { 0, 1, 0, -1, 1, 1, -1, -1 };

string abc = "abcdefghijklmnopqrstuvwxyz";
string vowels = "aeiouy"; //and sometimes "aeiouy"

template<typename X, typename Y> bool ckmin(X& a, Y b) { return a > b ? a = b, true : false; }
template<typename X, typename Y> bool ckmax(X& a, Y b) { return a < b ? a = b, true : false; }
bool cklex(string &a, string b) {
	if (b == "") return false;
	if (a == "") return a = b, true;
	if (sz(a) < sz(b)) return false;
	if (sz(b) < sz(a)) return a = b, true;
	if (a < b) return false;
	return a = b, true;
}

int dcmp(ld d1, ld d2) { return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1; } //Compare Double Numbers
ll gcd(ll x, ll y) { return !y ? x : gcd(y, x%y); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
int conv_2_1(int r, int c, int nCol) { return (nCol*r) + c + 1; } //convert index from 2D array to 1D array. (Zero-indexed)
ii conv_1_2(int n, int nCol) { return{ n / nCol, n % nCol }; } //convert index from 1D array to 2D array (row, col). (Zero-indexed)
template<typename T> void inter(T X) { cout << X << endl; fflush(stdout); }



void _solveD_() {

}

void _solveC_() {
	int n;
	cin >> n;
	ll ans = 0;
	for (int i = 1; i < n; i++) {
		int cnt = 0;
		for (int j = 1; j *j <= i; j++) {
			if (i%j) continue;
			cnt++;
		}
		int sq = sqrt(i);
		if (sq * sq == i) ans++, cnt--;
		ans += 2 * cnt;
	}
	cout << ans << endl;
}


int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int t = 1, tt = 0;
	//cin >> t;
	while (tt++ != t) {
		_solveC_();
	}


	return 0;
}


Measured memory_bytes: 3696