akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define mid (tl+tr)/2
#define mod 1000000007
#define fain(arr) for(int i=0;i<n;i++)cin>>arr[i];
#define all(x) x.begin(),x.end()
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define bugv(n1) if(DEBUG)cout<<#n1<<" is "<<n1<<'\n';
#define buga(A) cout<<#A<<" is :"<<endl ; for(auto x:A)cout<<x<<" "; cout<<endl;
#define FILE freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define endl '\n'
#define ll long long 
#define pii pair<int,int>
#define pll pair<long long ,long long >
#define pi acos(-1)
#define sz(x) ((int)x.size())
#define clr(x) memset(x, 0, sizeof(x))
#define init(x, a) memset(x, a, sizeof(x))
#define DEBUG true
using namespace std;

int main() {
  // FILE;
  SPEED;
  
  int n;
  cin>>n;

  ll w;
  cin>>w;

  ll wa[n];
  ll va[n];

  rep(i,0,n){
    cin>>wa[i];
    cin>>va[i];
  }

  ll dp[n][w+1];



  for(int i=0;i<=w;i++){
    if(i>=wa[n-1]){
      dp[n-1][i]=va[n-1];
    }
    else{
      dp[n-1][i]=0;
    }
  } 

  for(int i=n-2;i>=0;i--){
    for(int j=0;j<=w;j++){

      ll o1 = dp[i+1][j];
      ll o2 = LLONG_MIN;
      if(j-wa[i]>=0){
        o2=va[i]+dp[i+1][j-wa[i]];
      }
      dp[i][j]=max(o1,o2);
    }
  }


  // rep(j,0,w+1)
  // cout<<dp[n-1][j]<<" ";


  cout<<dp[0][w]<<endl; 

}

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

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

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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main()
{
int H, W;
	cin >> H >> W;
	fx(H) {
		fy(W) {
			string s;
			cin >> s;
			if (s=="snuke") {
				char al = 'A' + y;
				string ans{ al };
				
				cout << ans << x + 1 << endl;
			}
		}
	}
    return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <vector>
#include <cmath>
#include <tuple>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <queue>
#include <numeric>
#include <iostream>

using namespace std;

int main() {

    int ab, bc, ca;
    cin >> ab >> bc >> ca;

    cout << (ab * bc / 2) << "\n";

    return 0;
}

Measured memory_bytes: 256
num = int(input())
NIL = -1
MAX = 10000

class Node():
    def __init__(self, data):
        self.data = data
        self.left = None
        self.right = None

class BST():
    def __init__(self):
        self.root = None
        self.In = []
        self.Pr = []
    
    def insert(self, data):
        n = self.root
        if n == None:
            self.root = Node(data)
            return 
        else:
            while True:
                entry = n.data
                if data < entry:
                    if n.left == None:
                        n.left = Node(data)
                        return
                    n = n.left
                elif data > entry:
                    if n.right == None:
                        n.right = Node(data)
                        return
                    n = n.right
                else:
                    n.data =data
                    return
                
    def inorder(self, node):
        if node != None:
            self.inorder(node.left)
            self.In.append(node.data)
            self.inorder(node.right)
        return self
    
    def preorder(self, node):
        if node != None:
            self.Pr.append(node.data)
            self.preorder(node.left)
            self.preorder(node.right)
        return self

a = BST()
for i in range(num):
    order = input().split()
    
    if order[0] == 'print':
        a.In = []
        a.Pr = []
        a.inorder(a.root)
        In = [str(j) for j in a.In]
        a.preorder(a.root)
        Pr = [str(j)  for j in a.Pr]
        print(' ' + ' '.join(In))
        print(' ' + ' '.join(Pr))
    else:
        order[1] = int(order[1])
        if i == 0:
            root = order[1]
        a.insert(order[1])


Measured memory_bytes: 185808
#include<stdio.h>
#include<stdlib.h>
#define MAX 500000
#define INF 2000000000
typedef struct Cards{
  int number;
  char mark;
}card;
void quickSort(int, int);
int partition(int, int);
void swapCard(card *, card *);
void merge(int, int, int, int);
void mergeSort(int, int, int);
int isStable(void);
card L[MAX/2+2], R[MAX/2+2], *M, *Q;
int n;
int main(){
  int i, num;
  char c;
 
  scanf("%d",&n);
  Q = malloc(sizeof(card) * n);
  M = malloc(sizeof(card) * n);
  for (i = 0; i < n; i++) {
    scanf(" %c %d", &c, &num);
    M[i].number = num;
    M[i].mark = c;
    Q[i].number = num;
    Q[i].mark = c;
  }
  quickSort(0,n-1);
  mergeSort(n, 0, n);
  if ( isStable() ){
    printf("Stable\n");
  } else {
    printf("Not stable\n");
  }
  for (i = 0; i < n; i++) {
    printf("%c %d\n", Q[i].mark, Q[i].number);
  }
  return 0;
}
void quickSort(int p, int r){
  int q;
  if ( p < r ) {
    q = partition(p, r);
    quickSort(p, q-1);
    quickSort(q+1, r);
  }
  return ;
}
int partition(int p, int r){
  int i, j, key;
  key = Q[r].number;
  j = p-1;
  for (i = p; i < r; i++) {
    if ( Q[i].number <= key ) {
      j++;
      swapCard(&Q[i], &Q[j]);
    }
  }
  swapCard(&Q[j+1], &Q[r]);
  return j+1;
}
void mergeSort(int n, int left, int right){
  int mid;
  if( left + 1 < right ) {
    mid = (left + right) / 2;
    mergeSort(n, left, mid);
    mergeSort(n, mid, right);
    merge(n, left, mid, right);
  }
  return;
}
void merge(int n, int left, int mid, int right){
  int i, j, k, n1, n2;
  n1 = mid - left;
  n2 = right - mid;
  for (i = 0; i < n1; i++) {
    L[i] = M[left + i];
  }
  for (i = 0; i < n2; i++) {
    R[i] = M[mid + i];
  }
  L[n1].number = INF;
  R[n2].number = INF;
  i = 0;
  j = 0;
  for(k = left; k < right; k++) {
    if ( L[i].number <= R[j].number ) {
      M[k] = L[i];
      i++;
    } else {
      M[k] = R[j];
      j++;
    }
  }
}
void swapCard(card *Q1, card *Q2){
  card tmp;
  tmp = *Q1;
  *Q1 = *Q2;
  *Q2 = tmp;
  return ;
}
int isStable(void){
  int i, j;
  for (i = 0;i < n; i++) {
    if ( Q[i].mark != M[i].mark) {
      return 0;
    }
  }
  return 1;
}

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

struct node{
	int key;
	node *p,*left,*right;
};

node *root, *NIL;

void insert(int k)
{
	 node *y=NIL;
	 node *x=root;
	 node *z;
	 z=(node *)malloc(sizeof(node));
	 z->key=k;
	 z->left=NIL;
	 z->right=NIL;
	 while(x!=NIL)
	 {
	 	y=x;
	 	if(z->key < x->key)
	 	{
	 		x=x->left;
		 }
		 else {
		 	x=x->right;
		 }
	 }
	 z->p=y;
	 if(y==NIL)
	 {
	 	root=z;
	 }
	 else 
	 {
	 	if(z->key<y->key)
	 	{
	 		y->left=z;
		 }
		 else 
		 {
		 y->right=z;
		 }
	 }
}

void inorder(node *u)
{
	if(u==NIL)return;
	inorder(u->left);
	printf(" %d",u->key);
	inorder(u->right);
}

void preorder(node *u)
{
	if(u==NIL)return;
	printf(" %d",u->key);
	preorder(u->left);
	preorder(u->right);
}
int main()
{
	int n,i,x;
	string com;
	scanf("%d",&n);
	
	for(i=0;i<n;i++)
	{
		cin>>com;
		if(com=="insert")
		{
			scanf("%d",&x);
			insert(x);
		}
		else if(com=="print")
		{
			inorder(root);
			printf("\n");
			preorder(root);
			printf("\n");
		}
	}
	return 0;
}



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

template<typename T>
istream& operator >> (istream& istr, vector<T>& v){
    for(T& x: v) istr >> x;
    return istr;
}

template<typename T, typename U>
istream& operator >> (istream& istr, pair<T,U>& p){
    istr >> p.first >> p.second;
    return istr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<T>& v){
    if(!v.empty()){
        ostr << v.front();
        for(auto itr = ++v.begin(); itr != v.end(); itr++)
            // ostr << *itr;
            ostr << " " << *itr;
    }
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, pair<T,U>& p){
    // ostr << p.first << p.second;
    // ostr << p.first << ", " << p.second;
    ostr << "(" << p.first << ", " << p.second << ")";
    return ostr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<vector<T>>& vv){
    if(!vv.empty()){
        ostr << vv.front();
        for(auto itr = ++vv.begin(); itr != vv.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, vector<pair<T,U>>& vp){
    if(!vp.empty()){
        ostr << vp.front();
        for(auto itr = ++vp.begin(); itr != vp.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

typedef long long ll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<double> vd;
// vll v(n); v[i]=x;
typedef vector<vll> vvll;
typedef vector<vc> vvc;
typedef vector<vd> vvd;
// vvll v(m,vll(n)); v[i][j]=x;
typedef pair<ll,ll> pll;
typedef pair<double,double> pd;
typedef vector<pll> vpll;
typedef vector<pd> vpd;
// vpll v(n); v[i]=make_pair(x,y); v[i].first/second;
// v.front() : v[0]
// v.back()  : v[v.size()-1]

#define PI 3.1415926535897932
#define EPS 1e-12
#define INF ((ll)1e+12)
#define REP(i,n) for(ll i=0; i<(n); i++)
#define RREP(i,n) for(ll i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(ll i=(a); i<=(b); i++)
#define FORR(i,a,b) for(ll i=(b); i>=(a); i--)
#define fix(x) cout << fixed << setprecision(x)
#define dump(x) cout << #x << " = " << (x) << endl
#define all(x) (x).begin(),(x).end()

template<typename T> T sum(vector<T>& v){return accumulate(all(v), (T)0);}
template<typename T> inline void sort(vector<T>& v){sort(all(v));}
template<typename T> inline void rsort(vector<T>& v){sort(all(v), greater<T>());}
template<typename T> inline void chmin(T& a, T b){if(a>b) a=b;}
template<typename T> inline void chmax(T& a, T b){if(a<b) a=b;}

int main(){
    ll n, j=1;
    cin >> n;
    vll a(n);
    cin >> a;

    vector<map<ll,ll>> dp(n+1);
    dp[1][1] = a[0];
    dp[2][1] = max(a[0], a[1]);

    FOR(i,3,n){
        j = i/2;
        if(i%2==0){
            dp[i][j-1] = max(dp[i-1][j-1], dp[i-2][j-2]+a[i-1]);
            dp[i][j  ] = max(dp[i-1][j  ], dp[i-2][j-1]+a[i-1]);
        }
        else{
            dp[i][j  ] = max(dp[i-1][j  ], dp[i-2][j-1]+a[i-1]);
            dp[i][j+1] = dp[i-2][j  ]+a[i-1];

        }
    }

    cout << dp[n][j] << endl;
    return 0;
}


Measured memory_bytes: 39136
import java.util.Scanner;
public class Main{
	static char[][] map;
	static int h;
	static int w;
	static int[] dx={0,0,-1,1};
	static int[] dy={1,-1,0,0};
	static boolean[][] ma;
	static long countw;
	static long countb;
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		h=sc.nextInt();
		w=sc.nextInt();
		map=new char[h][w];
		ma=new boolean[h][w];
		for(int i=0; i<h; i++){
			String s=sc.next();
			map[i]=s.toCharArray();
		}
		long ans=0;
		for(int i=0; i<h; i++){
			for(int j=0; j<w; j++){
				if(!ma[i][j]){
					countw=0;
					countb=0;
					dfs(i,j);
					ans+=countw*countb;
				}
			}
		}
		System.out.println(ans);
	}
	static void dfs(int x,int y){
		ma[x][y]=true;
		if(map[x][y]=='.'){
			countw++;
		}else{
			countb++;
		}
		for(int i=0; i<4; i++){
			if(check(x+dx[i],y+dy[i])){
				if((map[x][y]=='.' && map[x+dx[i]][y+dy[i]]=='#') || (map[x][y]=='#' && map[x+dx[i]][y+dy[i]]=='.')){
					dfs(x+dx[i],y+dy[i]);
				}
			}
		}
		return;
	}
	static boolean check(int x,int y){
		return x>=0 && x<h && y>=0 && y<w && !ma[x][y];
	}
}


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

int main(){
  int N;
  cin>>N;
  if(N<10){
    cout<<N<<endl;

  }else if(N<100){
    cout<<9<<endl;

  }else if(N<1000){
    cout<<N-99+9<<endl;

  }else if(N<10000){
    cout<<909<<endl;

  }else if(N<100000){
    cout<<N-9999+909<<endl;

  }else if(N==100000){
    cout<<90909<<endl;
  }
}

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

#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define xx first
#define yy second
#define mx 1000000000000000000

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    ll n, p;
    cin >> n;

    ll x=1, yes=0, zero=0;
    for(int i=0;i<n;i++)
    {
        cin >> p;

        if(p == 0 || zero)
        {
            zero=1;
            continue;
        }

        ll tmp = mx/p;

        if(tmp >= x) x*=p;
        else yes=1;
    }

    if(zero) cout << 0 <<  endl;
    else if(yes) cout << -1 << endl;
    else cout << x << endl;

    return 0;
}


Measured memory_bytes: 3652
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<set>
#include<map>
#include<queue>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);++i)
#define rrep(i,n) for(int (i)=(n)-1;(i)>=0;--i)
#define rep1(i,n) for(int (i)=1;(i)<=(n);++i)
#define rrep1(i,n) for(int (i)=(n);(i)>=1;--i)
#define pb push_back
#define fr first
#define sc second
typedef long long ll;
typedef pair<int,int> P;
typedef pair<long long,long long> LP;
typedef double db;
using namespace std;
ll X,Y;
int main(){
  cin>>X>>Y;
  if(abs(X-Y)>1LL) puts("Alice");
  else puts("Brown");
}


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

using namespace std;

long long solve(const string& S, int k){
    int dst = 0;
    long long res = 0;
    long long cnt = 0;
    int m = 0;
    int c = 0;
    for(int i=0;i<S.size();i++){
        while(dst < S.size() && dst - i < k){
            if(S[dst] == 'M') ++m;
            if(S[dst] == 'C'){ ++c; cnt += m; }
            ++dst;
        }
        if(S[i] == 'D') res += cnt;
        if(S[i] == 'M') { cnt -= c; --m; }
        if(S[i] == 'C') --c;
    }
    return res;
}

int main(){
    int N; cin >> N;
    string S; cin >> S;
    int Q; cin >> Q;
    for(int i=0;i<Q;i++){
        int k; cin >> k;
        cout << solve(S, k) << endl;
    }
}

Measured memory_bytes: 5304
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
int count=0;
int i=0;
cin>>n;
int a[n],b[n],c[n];
for(i=1;i<=n;i++){
cin>>a[i];
}
  for(i=1;i<=n;i++){
cin>>b[i];
}
  for(i=1;i<n;i++){
cin>>c[i];
}
  for(i=1;i<=n;i++){
    if(a[i]==a[i+1]-1){
      count+=b[a[i]]+c[a[i]];
    }
    else{
      count+=b[a[i]];
    }
    }
  cout<<count<<endl;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
       
        String s = sc.next();
        char[] s_chars = s.toCharArray();
        Arrays.sort(s_chars);
        
        String s_asc = new String(s_chars);
        
        String t = sc.next();
        char[] t_chars = t.toCharArray();
        Arrays.sort(t_chars);
        String t_asc = new String(t_chars);
        String t_desc = new StringBuilder(t_asc).reverse().toString();
        
        if(s_asc.compareTo(t_desc) < 0){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
using ll= long long ;
using P = pair<ll,ll>;
#define rep(i,n) for (ll i = 0; i<(ll)(n); i++)
#define mod 1000000007
#define pi 3.141592653589793
typedef vector<ll> vcl;

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a, ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t =rep_jijo(n,x/2);
        return t*t%mod;
  }
  return n*rep_jijo(n,x-1)%mod;
}

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
ll a[100010][3];
   ll dp[100010][3];

int main() {
   ll N;
   cin>>N;
   
   rep(i,N){
       rep(j,3){
           cin>>a[i][j];
       }
   }

   rep(i,N){
       rep(j,3){
           rep(k,3){
               if(j==k){
                   continue;
                   }
               
               chmax(dp[i + 1][k], dp[i][j] + a[i][k]);
           }
       }
   }
   
   ll ans=0;
   rep(i,3){chmax(ans,dp[N][i]);}
    cout << ans << endl;
   return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

ll n,m,x,k,d,i,j,index,flag=0,mini,count=0,result,odd,even,sum=0,temp;
cin>>n;

ll a[200005];
//ll b[200005];
for(i=0;i<n;i++)
{
    cin>>a[i];
}

for(i=1;i<n;i++)
{
    if(a[i]<a[i-1])
    {
       temp=a[i-1]-a[i];
       a[i]=a[i]+temp;
       sum+=temp;
       //cout<<sum<<"   ";
    }
}
//cout<<endl;
cout<<sum<<endl;

    return 0;
}


Measured memory_bytes: 5176
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		String s = in.next();
		System.out.println(solve(n, s));
	}

	private static String solve(int n, String s) {
		if (n % 2 != 0)
			return "No";
		for (int i = 0, j = n / 2; i < n / 2; i++, j++)
			if (s.charAt(i) != s.charAt(j))
				return "No";
		return "Yes";
	}
}

Measured memory_bytes: 21460
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#endif

#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <vector>

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair<LL, LL> II;
typedef pair<LL, II> III;
typedef priority_queue<III, vector<III>, greater<>> Queue;
static const LL INF = 1LL << 60;

LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }
LL lcm(LL a, LL b) { return (a / gcd(a, b)) * b; }

#if 0
	auto possible = [&](LL t) {

		return false;
	};
	LL left = 1, right = 1000000000;
	while (right - left > 1) {
		LL mid = (left + right) / 2;
		if (possible(mid)) {
			left = mid;
		} else {
			right = mid;
		}
	}
#endif

void solve(long long N) {
	LL ans = 0;
	for (LL a = 1; a < N; ++a) {
		for (LL b = 1; b < N; ++b) {
			LL x = a * b;
			if (x >= N) break;
			++ans;
		}
	}
	cout << ans << endl;
}

int main() {
    long long N;
	std::cin >> N;
	solve(N);
	return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define endl '\n'
#define INF (1 << 21)
typedef long long ll;
const int MOD = 1000000007;
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b;
  
  cin >> a >> b;
  if(a % 2 == 0 || b % 2 == 0){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N;
  cin>>N;
  int a[N][N];
  bool tmp1, tmp2;
  for(int i=0;i<N-1;++i) {
    for(int j=i+1;j<N;++j) {
      for(int k=0;k<1000;++k) {
        tmp1 = (i&(1<<k));
        tmp2 = (j&(1<<k));
        if((tmp1!=0 && tmp2==0) || (tmp1==0 && tmp2!=0)) {
          a[i][j] = k+1;
          break;
        }
      }
    }
  }
  for(int i=0;i<N-1;++i) {
    for(int j=i+1;j<N;++j) {
      cout<<a[i][j]<<" ";
    }
    cout<<endl;
  }
}



Measured memory_bytes: 4416
#include <bits/stdc++.h>
using namespace std;
int saihin(vector<int> v,int n){//一番多く出てくる数と2番目に多く出てくる数を調べる
  int max1=0,max2=0,index1=-10,index2=-20;
  /*vector<int> vec(200000);
  max1 = 0;
  max2 = 0;
  index1 = -10;
  index2 = -20;
  for(int i=0; i<200000; i++){
    vec.at(i) = 0;
  }
  for(int i=0; i<v.size(); i++){
    vec.at(v.at(i)-1)++;
  }
  
  for(int i=0; i<6; i++){
    cout << vec.at(i) << " ";
  }
  cout << endl;
  
  for(int i=0; i<200000; i++){
    if(max1 <= vec.at(i)){
      max1 = vec.at(i);
      index2 = index1;
      max2 = max1;
      index1 = i+1;
      }
    if(max1 >= vec.at(i) && max2 <= vec.at(i) && index1 != i+1){
      max2 = vec.at(i);
      index2 = i+1;
      }
    }*/
  map<int,int> m;
  for(int i=0; i<100001; i++){
    m[i] = 0;
  }
  for(int i=0; i<v.size(); i++){
    m[v.at(i)]++;
  }
  for(int i=1; i<100001; i++){
    if(max1 < m[i]){
      max2 = max1;
      index2 = index1;
      max1 = m[i];
      index1 = i;
    }else{
      if(max2 < m[i]){
        max2 = m[i];
        index2 = i;
      }
    }
  }
  if(n==1){return index1;}
  if(n==2){return index2;}
}

int igai(vector<int> v,int n){
  int cntigai = 0;
  for(int i=0; i<v.size(); i++){
    if(v.at(i) != n){
      cntigai++;
    }
  }
  return cntigai;
}

int main(){
  int n;
  cin >> n;
  vector<int> e(n/2);
  vector<int> o(n/2);
  for(int i=0; i<n/2; i++){
    cin >> e.at(i) >> o.at(i);
  }
  int e1 = saihin(e,1);
  int e2 = saihin(e,2);
  int o1 = saihin(o,1);
  int o2 = saihin(o,2);
  
 
/*  cout << e1 << e2 << o1 << o2 <<endl;
  for(int i=0; i<n/2; i++){
    cout << e.at(i) << " ";
  }  
  cout << endl;
  for(int i=0; i<n/2; i++){
    cout << o.at(i) << " ";
  }
  cout << endl;*/
  
  
  if(e1 != o1){
    cout << igai(e,e1)+igai(o,o1) << endl;
  }else{
    cout << min(igai(e,e1)+igai(o,o2),igai(e,e2)+igai(o,o1)) << endl;
  }
  return 0;
}

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

int N;
int t[1000000];

int main(){
  cin>>N;
  
  for(int i=0;i<N;i++){
    int x;
    cin>>x;
    t[x]++;
  }

  int sum=0;
  
  for(int i=N-1;i>=1;i-=2){
    sum+=t[i];
    if(t[i]!=2){
      cout<<0<<endl;
      return 0;
    }
  }

  if(N%2==1){
    sum+=t[0];
    if(t[0]!=1){
      cout<<0<<endl;
      return 0;
    }
  }

  if(sum!=N){
    cout<<0<<endl;
    return 0;
  }


  long long ans=1;
  long long mod=1e9+7;
  for(int i=0;i<N/2;i++){
    ans=(ans*2LL)%mod;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 640
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, K = MAP()
    H = [INT() for i in range(N)]
    H = sorted(H)

    ans = INF
    for i in range(N-K+1):
        ans = min(ans, H[i+K-1] - H[i])

    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 45404
A=[]
def pushBack(x):
    A.append(x)
def randomAccess(x):
    if len(A)==0:
        return
    print(A[x])
def popBack():
    if len(A)==0:
        return
    A.pop()
q=int(input())
for i in range(q):
	a=list(map(int,input().split()))
	if a[0]==0:
		pushBack(a[1])
	elif a[0]==1:
		randomAccess(a[1])
	elif a[0]==2:
		popBack()


Measured memory_bytes: 13368
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>; 
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1001001001LL;
constexpr long long LINF = 1001001001001001001;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main(){
    int n; cin >> n;
    vector<ll> A(n); rep(i, n) cin >> A[i];
    sort(all(A));
    ll res = 0;
    for(int i=0; i<n; i++){
        for(int j=i+1; j<n; j++){
            //left < c < right
            int a = A[i], b = A[j];
            int l= max(a-b, b-a), r = a+b;
            int left = upper_bound(all(A), l) - A.begin();
            int right = lower_bound(all(A), r) - A.begin(); 
            res += right - left;
            if(l < a && a < r)res--;
            if(l < b && b < r)res--;
        }
    }
    cout << res / 3 << ln;
}
    


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

typedef pair<int, int> P; //x,y方向の移動を表すpairをpに置き換えた
char maze[55][55]; //迷路の格納
int d[55][55]; //各点までの最短距離
int h, w ,sy = 0,sx = 0;
const int  INF = 100000000;

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

int dfs(){
    int gx = w-1, gy = h-1;
    queue<P> que; //pairを格納するqueという名前のキュー
    rep(i,h)rep(j,w)d[i][j] = INF; //フラグも兼ねて全てをinfで初期化しておく
    que.push(P(sy,sx)); //スタートをキューに入れた
    d[sy][sx]=0;

    //キューが空になるまで
    while(!que.empty()){
        P po = que.front(); que.pop();
        // 取り出したのがゴールかどうか
        if(po.first == gy && po.second == gx) break;
        // 4方向ループ
        rep(i,4){
            int ny = po.first +dy[i], nx = po.second +dx[i];

            if(0<=nx && nx < w && 0<=ny && ny <h && d[ny][nx] == INF && maze[ny][nx] != '#'){
                que.push(P(ny, nx)); //移動できる場合新しく移動
                d[ny][nx] = d[po.first][po.second] +1;
            }
        }
    }
    return d[gy][gx];
}

int main(){
    int coun = 0;
    cin >> h >> w;
    rep(i,h)rep(j,w){
        cin >> maze[i][j];
        if (maze[i][j] == '.') coun += 1;
    }
    
    int res = coun - dfs() -1;
    if (res < 0) res = -1;
    printf("%d\n", res);
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long M = 1e9+7;
long long power(long long a, long long p)
    {
        if(p==0) return 1;
        long long ans= power(a,p/2);
        ans =(ans * ans) % M;
        if(p%2) ans = (ans*a) % M;
        return ans;
    }

    bool isPrime(long long n)
    {
        if (n <= 1)
            return false;
        for (long long i = 2; i < n; i++)
            if (n % i == 0)
                return false;
        return true;
    }
    long long SieveOfEratosthenes(long long n, long long a)
    {
        bool prime[n+1];
        memset(prime, true, sizeof(prime));
        for (long long p=2; p*p<=n; p++)
        {
            if (prime[p] == true)
            {
                for (long long i=p*p; i<=n; i += p)
                    prime[i] = false;
            }
        }
        for (long long p=2; p<=n; p++)
           if (prime[p])
           {
               if(a%p==0)
               {
                   return (a-p);
               }
           }
    }
    long long nCr(int n, int r)
    {
        if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
        long long ans = 1;
        int i;
        for(i = 1; i <= r; i++) {
            ans *= n - r + i;
            ans /= i;
        }
        return ans;
    }
int main()
{
    IOS;
    long long a,b,c,d,e,h,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
    // vector<string>vs;
    // vector<string>vs1;
    vector<char>vc;
    //map<long long,long long>mp;
    map<char,int>mp1;
    //set<long long>s;
    set<long long>s1;
    queue<long long> q;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
    // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    int x[]={1,1,1,0,0,-1,-1,-1};
    int y[]={0,1,-1,1,-1,1,-1,0};
    cin>>n;
    vector<long long>v(n);
    for(int i=0; i<n; i++)
    {
        cin>>v[i];
        v[i]=(v[i]-(i+1));
    }
    sort(v.begin(),v.end());
    if(n%2==0)
    {
        a=v[(n/2)-1];
    }
    else a=v[n/2];
    for(int i=0; i<n; i++)
        sum+=abs(v[i]-a);
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 1792
def main():
    N = int(input())
    A = tuple(map(int, input().split()))

    plus = 0
    minus = 0
    split = 1
    i = 0
    while i < N - 1:
        if A[i] == A[i+1]:
            pass
        elif A[i] < A[i+1]:
            if minus != 0:
                split += 1
                minus = 0
            else:
                plus = 1
        elif A[i] > A[i+1]:
            if plus != 0:
                split += 1
                plus = 0
            else:
                minus = 1
        i += 1

    print(split)

main()


Measured memory_bytes: 14352
from copy import copy
N, M = map(int, input().split())
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    G[b - 1].append(a - 1)
    G[a - 1].append(b - 1)

ans = 0
st = [[0, [False] * N]]
while len(st) > 0:
    _st = st.pop()
    v = _st[0]
    visited = copy(_st[1])
    if visited[v]:
        continue
    visited[v] = True
    adj_all_visit = True
    for adj in G[v]:
        if visited[adj]:
            continue
        st.append([adj, visited])
        adj_all_visit = False
    if adj_all_visit and all(visited):
        ans += 1
print(ans)


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

#include <math.h>
#include <stdlib.h>


#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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_MAX	2,147,483,647 = 2*1.0e9

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    vector<string> c(3);
    for(int i = 0; i <3; i++) cin >> c[i];

    cout << c[0][0] << c[1][1] << c[2][2] << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <sstream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <complex>
#include <vector>
#include <cstdio>
#include <cmath>
#include<utility>
#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
using namespace std;

template<class T>inline string toString(T x){
        ostringstream sout; sout<<x; return sout.str();
}
const ll MOD=1e9+7;
const int inf=(ll)1e9;
const double PI=acos(-1.0);

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.precision(10);
	cout<<fixed;
	int n;
	while(cin>>n,n){
		int dp[11][11];
		int m=0;
		for(int i=0;i<11;i++){
			for(int j=0;j<11;j++){
				dp[i][j]=inf;
			}
		}
		for(int i=0;i<11;i++){
			dp[i][i]=0;
		}
		for(int i=0;i<n;i++){
			int a,b,c;cin>>a>>b>>c;
			dp[a][b]=c;
			dp[b][a]=c;
			m=max(m,max(a,b));
		}
		m++;
		for(int k=0;k<m;k++){
			for(int i=0;i<m;i++){
				for(int j=0;j<m;j++){
					dp[i][j]=min(dp[i][k]+dp[k][j],dp[i][j]);
				}
			}
		}
		int ans=inf;
		int ansi=0;
		for(int i=0;i<m;i++){
			int sum=0;
			for(int j=0;j<m;j++){
				if(i==j)continue;
				sum+=dp[i][j];
			}
			if(ans>sum){
				ans=sum;
				ansi=i;
			}
		}
		cout<<ansi<<" "<<ans<<endl;
	}
	return 0;
}

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


void solve(long long N, long long K, std::vector<long long> H){
    ll ans;
    if(N <= K) ans = 0;
    else{
        sort(H.begin(), H.end(), greater<ll>());
        //for(auto h : H) cout << h << endl;
        for(ll i = 0; i < K; ++i) H[i] = 0;
        ans = accumulate(H.begin(), H.end(), 0LL);
    }
    cout << ans << endl;
    return;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> H(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&H[i]);
    }
    solve(N, K, std::move(H));
    return 0;
}


Measured memory_bytes: 4848
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mem(a,b) memset((a),(b),sizeof(a))
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
using namespace std;
#define _GLIBCXX_PERMIT_BACKWARD_HASH
#include <ext/hash_map>
using namespace __gnu_cxx;
struct str_hash{size_t operator()(const string& str)const{return __stl_hash_string(str.c_str());}};
typedef long long ll;
typedef unsigned long long ull;
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<double,double>
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3f;
const double PI=acos(-1.0);
const double eps=1e-6;
const int MAX=1e5+10;
const ll mod=1e9+7;
int main()
{
	ll n,i,j,mp[111][15],cnt[111],k,val[111][15],now;
	ll ans;
	while(~scanf("%lld",&n))
	{
		ans=-LLINF;
		for(i=0;i<n;i++)
		{
			for(j=0;j<10;j++) scanf("%lld",&mp[i][j]);
		}
		for(i=0;i<n;i++)
		{
			for(j=0;j<=10;j++) scanf("%lld",&val[i][j]);
		}
		for(i=1;i<(1<<10);i++)
		{
			mem(cnt,0);
			for(j=0;j<10;j++)
			{
				if(i&(1<<j))
				{
					for(k=0;k<n;k++)
					{
						cnt[k]+=mp[k][j];
					}
				}
			}
			now=0;
			for(k=0;k<n;k++) now+=val[k][cnt[k]];
			ans=max(ans,now);
		}
		printf("%lld\n",ans);
	}
	return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define each(it,v) for(auto &it : v)
#define mod 1000000007
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vl vector<long>
#define P pair<int,int>
using namespace std;

main()
{
        int n; cin>>n;
        set<int> s;
        s.insert(n);
        int cnt=1;
        while(true)
        {
                if(n%2==0)n/=2;
                else n=3*n+1;

                if(s.count(n))
                {
                        cout<<cnt+1<<endl;
                        return 0;
                }else
                {
                        cnt++;
                        s.insert(n);
                }
        }
}

Measured memory_bytes: 256
while True:
    try:
        xa, ya, xb, yb, xc, yc, xd, yd = map(float, input().split())
    except:
        break
    ab = (xb - xa, yb - ya)
    cd = (xd - xc, yd - yc)
    if abs(ab[0] * cd[0] + ab[1] * cd[1]) < 1e-11:
        print('YES')
    else:
        print('NO')

Measured memory_bytes: 7416
import bisect
n=int(input())
cnt=0
l= list(map(int, input().split()))
l.sort(reverse=True)
k=[[0 for i in range(n-2)] for j in range(n-2)]
for i in range(n-2):
    for j in range(i,n-2):
        k[i][j-i]=-l[i+1]-l[j+2]
#print(k)
for i in range(n-1):
    x=i
    while x<n-2:
        cnt+=bisect.bisect_left(k[x],-l[i])
        #print(l[i],bisect.bisect_left(k[x],-l[i]))
        x+=1
print(cnt)

Measured memory_bytes: 77916
#include<bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ll long long
//#define endl "\n"
#define vi vector<int>
#define vl vector<ll>
#define all(v) (v).begin(),(v).end()
#define mst(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define mt make_tuple
#define eb emplace_back
using namespace std;
void solve(){
    string s;
    cin>>s;
    if(s[1]=='B') cout<<"ARC"<<endl;
    else cout<<"ABC"<<endl;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll t,p;
    t=1;
    //cin>>t;
    for(p=1;p<=t;p++){
        solve();
    }
    return 0;
}


Measured memory_bytes: 3600
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);
		
		String[] cards = new String[n];
		for (int i = 0; i < cards.length; i++) {
			String c = sc.nextLine();
			cards[i] = c;
		}
		
		String[] suit = {"S","H","C","D"};
		
		for (int i = 0; i < 4; i++) {
			for (int j = 1 ; j <= 13; j++) {
				StringBuilder card = new StringBuilder();
				card.append(suit[i]);
				card.append(" ");
				String js = String.valueOf(j);
				card.append(js);
				String str = card.toString();
				if (Arrays.asList(cards).contains(str)) {
					continue;
				}
				System.out.println(card);
			}
		}
	}

}

Measured memory_bytes: 26020
#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

int main(){
	int n;
	cin >> n;
	vi v(n);
	rep(i, n) cin >> v[i];
	sort(all(v));
	if(v.back() - v[0] >= 2) {
		cout << "No" << endl;
		return 0;
	}

	if(v.back() == v[0]) {
		if(v.back() == n-1) cout << "Yes" << endl;
		else if(v[0]*2 > n) cout << "No" << endl;
		else cout << "Yes" << endl;
		return 0;
	}
	int cntB = 0;
	for(auto& a : v) if(a == v.back()) cntB++;
	int cntA = n - cntB;
	
	if(cntA + cntB/2 < v.back() || cntB == 1 || cntA > v[0]) cout << "No" << endl;
	else cout << "Yes" << endl;

	// if((v.back()-(n-cnt))*2 <= cnt) cout << "Yes" << endl;
	// else cout << "No" << endl;
}


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

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int K = Integer.parseInt(sc.next());
        sc.close();
        int odd = (K + 1) / 2;
        int even = K / 2;
        int num = odd * even;

        out.printf("%d\n", num);
        out.flush();
    }
}


Measured memory_bytes: 21204
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

long long n, x;

long long gcd(long long a, long long b) {
	if (a % b == 0) return a / b * b * 2 - b;
	return gcd(b, a % b) + a / b * b * 2;
}

int main() {
	scanf("%lld%lld", &n, &x);
	printf("%lld\n", gcd(n - x, x) + n);
	return 0;
}

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

typedef struct
{
  string name;
  int point, index;
} Team;

class GreaterPoint
{
public:
  bool operator() (const Team& lhs, const Team& rhs)
  {
    if (lhs.point == rhs.point)
      return lhs.index < rhs.index;
    return lhs.point > rhs.point;
  }
};

int main()
{
  int n;
  bool first = true;
  while (cin >> n) {
    if (n == 0)
      break;

    if (!first)
      cout << endl;

    vector<Team> team(n);
    for (int i = 0; i < n; ++i) {
      int win, draw;
      cin >> team[i].name >> win >> draw >> draw;
      team[i].point = win*3+draw;
      team[i].index = i;
    }

    sort(team.begin(), team.end(), GreaterPoint());
    for (int i = 0; i < n; ++i)
      cout << team[i].name << "," << team[i].point << endl;
    first = false;
  }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define f first
#define s second
#define ll long long
#define mp make_pair
#define pb push_back
#define sqr(x) (x)*(x)
#define matrix vector < vector<int> >

using namespace std;

const double eps = 1e-9;
const double PI = acos(-1.0);
const int INF = int (1e9);
const int mod = int (1e9+7);
const int N = int (2e5+7);    

int n, l, q, a[N], nxt[N][20];

int main () { 
   	//freopen("input.txt", "r", stdin);
   	//freopen("output.txt", "w", stdout);  
   	ios_base::sync_with_stdio(0);
	cin.tie(0);
	         
	cin >> n;
	for(int i = 0; i < n; i ++)
		cin >> a[i];
	cin >> l >> q;
	for(int i = 0, j = 0; i < n; i ++) {
		while(j < n && a[j] - a[i] <= l) j ++;
		nxt[i][0] = j - 1;
	}
	for(int j = 1; j < 20; j ++)
		for(int i = 0; i < n; i ++)
			nxt[i][j] = nxt[nxt[i][j - 1]][j - 1];
	for(int i = 0; i < q; i ++) {
		int x, y, ans = 1;
		cin >> x >> y;
		x --, y --;
		if(x == y) {
			cout << "0\n";
			continue;
		}
		if(x > y) 
			swap(x, y);
		for(int j = 19; j >= 0; j --)
			if(nxt[x][j] < y) 
				ans += 1 << j, x = nxt[x][j];
		cout << ans << endl;
	}
	return 0;
} 

Measured memory_bytes: 9088
using System;
using System.Linq;

namespace _4_D
{
    class Program
    {
        static void Main(string[] args)
        {
            int kosuu = Int32.Parse(Console.ReadLine());
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            long Sum=0;
            for(int i=0;i<kosuu;i++)
            {
                Sum += x[i];
            }
            Array.Sort(x);
            Console.WriteLine(x[0] + " " + x[kosuu-1] + " " + Sum);
        }
    }
}

Measured memory_bytes: 10648
N = int(input())
S = []
for i in range(N):
    S.append(input())

def check(S):
    for i in range(N):
        for j in range(i+1, N):
            if S[i][j] != S[j][i]:
                return 0
    return 1

cnt = 0
for i in range(N):
    cnt += check(S[i:] + S[:i])
print(cnt * N)


Measured memory_bytes: 3188
"use strict";
function I(s,f){this._s=s.split("\n");this._c=0;this._l=0;this._f=f||Number}I.prototype.a=function(){var l=this._s[this._l];if(!l)return;var t=l.trim().split(" ");var a=t[this._c];this._c++;if(t.length===this._c){this._c=0;this._l++}return this._f(a)};I.prototype.l=function(){var l=this._s[this._l];if(!l)return;this._c=0;this._l++;return l.split(" ").map(this._f)};
function buildArray(r,t){let l=t||0;for(let t=r.length;t>0;t--){const n=r[t-1];l=Array(n).fill().map(()=>JSON.parse(JSON.stringify(l)))}return l}

var mod = 1e9 + 7;
function abmod(){for(var a=arguments,r=a[0],i=1;i<a.length;)r=((r>>16)*a[i]%mod*65536+(r&65535)*a[i++])%mod;return r;}

function main(input) {
  var o = new I(input);

  var N = o.a();
  var X = o.a();
  
  var S = o.l();

  S.sort((a,b) => b - a);

  var dp1 = Array(X+1).fill(0);
  dp1[X] = 1;
  for (var i = 0; i< N; i++) {
    var dp2 = Array(X+1).fill(0);
    for (var j = 0; j<=X; j++) {
      dp2[j] += dp1[j] * (N-i-1);
      dp2[j] %= mod;

      var m = j%S[i];
      dp2[m] += dp1[j];
      dp2[m] %= mod;
    }
    dp1 = dp2;
  }

  var sum = 0;
  for(var i = 0; i < S[N-1]; i++){
    sum += abmod(i,dp1[i]);
  }

  console.log(sum % mod);
}


main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 42004
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define test int t;cin>>t;while(t--)
typedef long long int ll;
#define REP(i,n) for (int i = 1; i <= n; i++)
#define mod 1000000007
#define pb push_back
#define ff first
#define ss second
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define lli long long int
#define INF 1000000000
const double pi = 3.14159265358979323846;


void solve()
{
	int i=0,j=0,n=0,m=0;
    cin>>n>>m;
  cout<<m*n;
    
    
}

int main() {
    fast
    //test
    {
        
        solve();
		
		      
    }
    return 0;
}


Measured memory_bytes: 3668
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
#include <cctype>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <utility>


using namespace std;
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { a = abs(a), b = abs(b); while (b > 0) { tie(a, b) = make_pair(b, a % b); } return a; }
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
//constexpr long long mod = 1000000007LL;
constexpr long long mod = 998244353LL;

int main()
{

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

	constexpr ll mod = 2019;
	ll L, R; cin >> L >> R;
	ll res = INF;
	for (ll i = L; i <= R; i++) {
		for (ll j = i + 1; j <= R; j++) {
			chmin(res, (i * j) % mod);
			if (res == 0) break;
		}
		if (res == 0) break;
	}
	cout << res << endl;
	return 0;
}


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

long long ans = 0;
void solve_sqr(long long a, long long b)
{
	if (a > b) swap(a, b);
	if (a == 0) { ans -= b; return; }
	ans += (b/a)*a*2;
	solve_sqr(a, b%a);
}

int main()
{
	long long n, x;
	cin >> n >> x;
	solve_sqr(x, n-x);
	cout << ans+n << endl;
	return 0;
}


Measured memory_bytes: 256