akhauriyash/Code-Regression huggingface dataset:
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


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

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()) {
	v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t) {
	stringstream ss;
	ss << f;
	ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x)
#define debug(x)
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

bool prime[400000];

void mainmain() {
	rep(i, 400000) prime[i] = true;
	prime[0] = prime[2] = prime[3] = prime[4] = prime[5] = false;
	for(ll i = 2; i * i < 400000; i++) {
		if(prime[i]) {
			prime[i*i] = false;
			if(i % 7 == 1) {
				if(i * (i + 5) < 400000) prime[i * (i + 5)] = false;
				for(ll j = i + 7; ;) {
					if(i * j >= 400000) break;
					prime[i * j] = false;
					j += 5;
					if(i * j >= 400000) break;
					prime[i * j] = false;
					j += 2;
				}
			}
			else if(i % 7 == 6) {
				if(i * (i + 2) < 400000) prime[i * (i + 2)] = false;
				for(ll j = i + 7; ;) {
					if(i * j >= 400000) break;
					prime[i * j] = false;
					j += 2;
					if(i * j >= 400000) break;
					prime[i * j] = false;
					j += 5;
				}
			}
		}
	}
	ll n;
	vll p;
	reep(i, 2, 400000) if(prime[i] && (i%7==1 || i%7==6)) p.PB(i);
	while(cin >> n, n!=1) {
		cout << n << ":";
		rep(i, p.size()) {
			bool ok = false;
			if(n % p[i] == 0) {
				ok = true;
			}
			if(ok) cout << " " << p[i];
		}
		cout << endl;
	}
}


signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(20);
	mainmain();
}

Measured memory_bytes: 3752
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
#define INF 1e9
typedef pair<int, int> pi;
int used[10100];
int dist[10100];

int main() {
  int n;
  cin >> n;
  
  // first:weight, second:key
  priority_queue<pi, vector<pi>, greater<pi>> pqueue;
  // graph[from][to], first:key, second:distance
  vector<vector<pi>> graph(n);
  
  for (int i = 0; i < n; i++) {
    dist[i] = INF;
  }
  for (int i = 0; i < n; i++) {
    int u, k;
    cin >> u >> k;
    vector<pi> vec(k);
    int v, c;
    for (int j = 0; j < k; j++) {
      cin >> v >> c;
      vec[j] = make_pair(v, c);
    }
    graph[i] = vec;
  }

  pqueue.push(make_pair(0,0));
  dist[0] = 0;
  
  for (int i = 0; i < n; i++) {
    pi p = pqueue.top();
    pqueue.pop();
    int key = p.second;
    if (used[key] == 1) {
      i--;
      continue;
    }
    dist[key] = min(dist[key], p.first);
    used[key] = 1;
    for (int j = 0; j < graph[key].size(); j++) {
      if (used[graph[key][j].first] != 1) {
        int d = graph[key][j].second + dist[key];
        pqueue.push(make_pair(d, graph[key][j].first));
      }
    }
  }

  for (int i = 0; i < n; i++) {
    cout << i << " " << dist[i] << endl;
  }
}




Measured memory_bytes: 8884
n = int(input())
X = list(map(int, input().split()))
X.sort()
k=r=0
for i in range(n):
    k = i
    for j in range(i+1, n):
        while k<n and X[i]+X[j]>X[k]:
            k +=1
        r += k-j-1
print(r)


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

vector<int> G[5000], H[5000];
int N, K;
int C[5000], R[5000];
int memo[5000];

unordered_set<int> bfs(int start) {
  unordered_set<int> res;
  struct Node {int vertex, distance;};
  queue<Node> q;
  q.push({start, 0});
  while(!q.empty()) {
    auto node = q.front();
    q.pop();
    if(R[start] < node.distance) break;
    if(res.count(node.vertex)) continue;
    res.insert(node.vertex);
    for(const auto& v: G[node.vertex]) if(!res.count(v)) q.push({v, node.distance + 1});
  }
  return res;
}

int Dijkstra() {
  struct Node {int vertex, cost;};
  priority_queue<Node, vector<Node>, function<bool(Node, Node)>> q([](Node lhs, Node rhs){
    if(lhs.cost != rhs.cost) return lhs.cost > rhs.cost;
    return lhs.vertex < rhs.vertex;
  });
  set<int> visited;
  q.push({0, 0});
  while(!q.empty()) {
    auto node = q.top();
    q.pop();
    if(node.vertex == N - 1) return node.cost;
    if(visited.count(node.vertex)) continue;
    visited.insert(node.vertex);
    for(const auto& v: H[node.vertex]) if(!visited.count(v)) if(node.cost + C[node.vertex] < memo[v])
        q.push({v, (memo[v] = node.cost + C[node.vertex])});
  }
  throw "NG";
}

int main() {
  cin >> N >> K;
  for(int i = 0; i < N; ++i) {
    cin >> C[i] >> R[i];
    memo[i] = INT_MAX;
  }

  for(int i = 0; i < K; ++i) {
    int A, B;
    cin >> A >> B;
    --A;
    --B;
    G[A].push_back(B);
    G[B].push_back(A);
  }

  for(int u = 0; u < N; ++u) for(const auto& v: bfs(u)) H[u].push_back(v);
  cout << Dijkstra() << endl;
}

Measured memory_bytes: 71720
using System;

namespace a
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var k = int.Parse(Console.ReadLine());
            var x = int.Parse(Console.ReadLine());
            var y = int.Parse(Console.ReadLine());

            var s = 0;
            if(n >= k){
                s = k * x;
                s += ((n - k) * y);
            }else{
                s = n * x;
            }

            Console.WriteLine(s);
        }
    }
}


Measured memory_bytes: 13140
N = int(input())
A = list(map(int, input().split()))
sm = sum(A)
t = 0
for i in range(N):
    if t > sm/2:
        break
    else:
        t += A[i]
        s = t-A[i]
u = 2*t - sm
v = sm - 2*s
print(min(u,v))

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

const ll INF = 4e18;

int main(){
  int n, k;
  cin >> n >> k;
  
  vector<ll> x(n),y(n); 

  rep(i,n) {
    cin >> x[i] >> y[i];
  }
  vector<P> px,py;
  rep(i,n) {
    px.push_back({x[i],i});
    py.push_back({y[i],i});
  }
  sort(px.begin(),px.end());
  sort(py.begin(),py.end());

  vector<int> xc(n),yc(n);
  rep(i,n) {
    xc[px[i].second] = i;
    yc[py[i].second] = i;
  } 

  vector<vector<int> > cnt(n+1, vector<int>(n+1,0));
  rep(i,n) cnt[xc[i]+1][yc[i]+1]++;

  rep(i,n+1){
    rep(j,n+1){
      if (i > 0 && j > 0) cnt[i][j] += cnt[i-1][j] + cnt[i][j-1] - cnt[i-1][j-1];
    }
  } 
  ll res = INF;
  
  for (int xi = 0; xi < n; xi++) for (int xj = xi + 1; xj < n ; xj++) {
    for (int yi = 0; yi < n; yi++) for (int yj = yi + 1; yj < n; yj++) {
      int m = cnt[xj+1][yj+1] - cnt[xj+1][yi] - cnt[xi][yj+1] + cnt[xi][yi];
      if (m < k) continue;
      res = min(res, (px[xj].first-px[xi].first)*(py[yj].first-py[yi].first));
    }
  }
  
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 256
/*********************************************************************************\
*  _________  _      _  ________  _       _       __       ________               *
* |___   ___|| |    | ||  ______|| |     | |     /  \     |  ____  |              *
*     | |    | |    | || |______ | |_____| |    / /\ \    | |____| |              *
*     | |    | |    | ||______  ||  _____  |   / /__\ \   |  __  __|              *
*     | |    | |____| | ______| || |     | |  / ______ \  | |  \ \                *
*     |_|    |________||________||_|     |_| /_/      \_\ |_|   \_\               *
*                                                                                 *
*   Department of Computer Science & Engineering                                  *
*   Student ID : 18CSE035                                                         *
*   Bangabnadhu Sheikh Mujibur Rahman Science & Technology University,Gopalgonj.  *
*                                                                                 *
\*********************************************************************************/

//Now Write to Code ___________________________


#include <bits/stdc++.h>
using namespace std ;
 
 
typedef long long                ll;
typedef long double              ld;
typedef unsigned long long       ull;
typedef pair <int,int>           pii;
typedef pair <ll,ll>             pll;
typedef vector <int>             vi;
typedef vector <ll>              vll;
typedef vector <vector <int> >   vvi;
 
inline int    Int(){int x; cin >> x; return x;}
inline ll     Long(){ll x; cin >> x; return x;}
inline float  Float(){float x; cin >> x; return x;}
inline double Double(){double x; cin >> x; return x;}
inline void   Yes(){cout << "Yes" << endl;}
inline void   No(){cout << "No" << endl;}
inline void   YES(){cout << "YES" << endl;}
inline void   NO(){cout << "NO" << endl;}
 
const int N             =(int)2e5 + 5;
const int maxN          =(int)1e6 + 6;
const ll  Mod           =(ll)1e9 + 7;
const int inf           =(int)2e9;
const ll  Inf           =(ll)1e18;
 
#define     T           int t,q; cin >> t; for(q=1;q<=t;q++)
#define     debug(x)    cerr << #x << " = " << x << '\n' ;
#define     rep(i,b,e)  for(__typeof(e) i=(b); i!=(e+1)-2*(b > e); i =i+1-2*(b > e))
#define     Int         Int()
#define     Long        Long()
#define     Float       Float()
#define     Double      Double()
#define     all(x)      x.begin() , x.end()
#define     sz(x)       (int)x.size()
#define     ff          first
#define     ss          second
#define     pb          push_back
#define     eb          emplace_back
#define     mem(a)      memset(a , 0 ,sizeof a)
#define     memn(a)     memset(a , -1 ,sizeof a)
#define     biday       return 0 
#define     PI          3.141592653589793238462643383279502884L
 
 
int main()
{
	string s,t;
	cin >> s >> t;
	int len = s.size(),len1=t.size(),c=1,i;
	for(i = 0; i < len; i++)
	{
		if(s[i]!=t[i])
		{
           c=0;
           break;
		}
	}
	if(c && len<len1)Yes();
	else No();
   

    biday;
}
 
//...............BYE BYE................

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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q>
ostream& operator << (ostream& os, pair<P, Q> p)
{
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template<typename T>
ostream& operator << (ostream& os, vector<T> v)
{
  os << "(";
  each (i, v) os << i << ",";
  os << ")";
  return os;
}

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n, m;
  while (cin >> n >> m) {
    vector<lli> a(n);
    each (i, a) cin >> i;
    map<lli, vector<int>> idx;
    vector<lli> v;
    for (int i = 0; i < a.size(); ++i) {
      if (i) v.push_back(v.back() + a[i]);
      else v.push_back(a[i]);
      v.back() %= m;
      idx[v.back()].push_back(i);
    }
    lli sum = idx[0].size();
    for (int i = 0; i < v.size(); ++i) {
      sum += idx[v[i]].size() - (lower_bound(idx[v[i]].begin(), idx[v[i]].end(), i) - idx[v[i]].begin()) - 1;
    }
    cout << sum << endl;
  }

  return 0;
}


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

int N;
vector<long long> x, y;

int solve(){
    if(N == 1) return 1;

    int res = N;
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            if(i == j) continue;
            long long dx = x[j] - x[i], dy = y[j] - y[i];

            int sub = 0;
            for(int i2 = 0; i2 < N; i2++){
                for(int j2 = 0; j2 < N; j2++){
                    if(j2 == i2) continue;
                    if(dx == x[j2] - x[i2] && dy == y[j2] - y[i2]) ++sub;
                }
            }
            res = min(res, N - sub);
        }
    }
    return res;
}
int main(){
    cin >> N;
    x.resize(N); y.resize(N);
    for(int i = 0; i < N; i++) cin >> x[i] >> y[i];
    cout << solve() << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <tuple>

using namespace std;

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

long long int INF = 1e18;
long long int mod = 998244353;
double Pi = 3.1415926535897932384626;

vector<ll> G[500005];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "RULD";
//↓,→,↑,←

#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<x;
#define re(i,n) for(i=0;i<n;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define deba(x) cout<< #x << " = " << x <<endl

ll rui(ll number1,ll number2){
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
    if(number1 > number2){
        swap(number1 , number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1 , number1);
    }
}
void YES(bool condition){
	if(condition){
		p("YES");
	}else{
		p("NO");
	}
	return;
}
void Yes(bool condition){
	if(condition){
		p("Yes");
	}else{
		p("No");
	}
	return;
}

ll i,j,k,ii,jj,n,m,a,b,c,d,e,f,g,h,r,w,l,num,sum,ans,ok,ng,mid;
ll x[500005],y[500005],z[500005];
char s[500005],t[500005],u[500005];
bool dame,flag;
//string s;
int main(){
	cin >> a >> b;
	if(b%a == 0){
		p(a+b);
	}else{
		p(b-a);
	}
	
	return 0;
}

Measured memory_bytes: 24704
import java.util.Scanner;

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

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int[] h = new int[n];

int cnt =  0;
		for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(sc.next());
			if(h[i] >= k) {
				cnt++;
			}
		}


		
		System.out.println(cnt);
		sc.close();
	}
}

Measured memory_bytes: 48232
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n,t=map(int,input().split())
a=list(map(int,input().split()))
lst=[0]*(n+1)

for i in range(n):
    lst[-2-i]=max(lst[-1-i],a[-1-i])
# print(lst)

sa=0
cnt=0
for i in range(n):
    if sa<lst[i]-a[i]:
        sa=lst[i]-a[i]
        cnt=1
    elif sa==lst[i]-a[i]:
        cnt+=1
    else:
        pass
print(cnt)

Measured memory_bytes: 59704
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define PB push_back

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}

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

signed main(void)
{
  int q;
  cin >> q;
  REP(i, q) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    c--, d--;

    int len = ceil(max(a,b), min(a,b)+1);
    int lb = 0, ub = a+1;
    while(ub-lb > 1) {
      int mid = (lb+ub)/2;
      int numb = max(0LL, (mid-1)/len);
      if(b-numb <= (a-mid+1)*len) {
        lb = mid;
      } else {
        ub = mid;
      }
    }

    int mae = lb + max(0LL, (lb-1)/len);
    // cout << lb << " " << max(0LL, (lb-1)/len) << " " << mae << endl;
    string ret = "";
    FOR(i, c, d+1) {
      if(i < mae) {
        if((i+1) % (len+1) == 0) ret += 'B';
        else ret += 'A';
      } else {
        // cout << (a+b-i) << endl;
        if((a+b-i) % (len+1) == 0) ret += 'A';
        else ret += 'B';
      }
    }

    cout << ret << endl;
  }

  return 0;
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

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

        int A = sc.nextInt();
        int P = sc.nextInt();

        int applePie = (3 * A + P) / 2;
        System.out.println(applePie);

    }
}


Measured memory_bytes: 23764
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>

#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(a) (a).begin(), (a).end()

using namespace std;

int main() {
    int K;
    cin >> K;

    vector<int> A(K);

    REP(i, K)
    cin >> A[i];

    if (A[K - 1] != 2) {
        cout << -1 << endl;
        return 0;
    }

    long long up = 3;
    long long down = 2;

    for (int i = K - 1; i >= 0; i--) {
        long long v;
        if (down % A[i] == 0)
            v = down;
        else
            v = down - down % A[i] + A[i];
        if (v < down || up < v) {
            cout << -1 << endl;
            return 0;
        }

        down = v;
        up = up - up % A[i] + A[i] - 1;
    }

    cout << down << " " << up << endl;

    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N,t,a,n;
  cin >> N;
  int T[N], A[N];
  for (int i = 0; i < N; i++) {
    cin >> T[i] >> A[i];
  }
  t = T[0];
  a = A[0];
  n = 1;
  for (int i = 1; i < N; a=A[i], t = T[i++]) {
    n = max((t*n-1)/T[i]+1,(a*n-1)/A[i]+1);
  }
  cout << (a+t)*n;
}

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

using namespace std;

int main()
{
    long long a, b, x;
    cin >> a >> b >> x;
    long long min = a/x + (a % x ? 1 : 0);
    long long max = b/x;
    cout << (max - min + 1) << endl;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        List<int> cin = Console.ReadLine().Split().Select(i => int.Parse(i)).ToList();
        cin.Sort();
        if ((cin[1] - cin[0]) % 2 == 0)
        {
            Console.WriteLine((cin[2] - cin[1]) + (cin[1] - cin[0]) / 2);
        }
        else
        {
            Console.WriteLine((cin[2] - cin[1]) + (cin[1] - cin[0]) / 2 + 2);
        }
    }
}

Measured memory_bytes: 13268
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();

            int pot = 1;
            for (int i = 0; i < M; i++) pot *= 2;
            out.println(pot * (M * 1900 + (N - M) * 100));
        }

    }

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

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

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

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

    }
}



Measured memory_bytes: 21460
#include <iostream>
#define REP(i, a, n) for(int i = (a); i < (n); i++)
using namespace std;

int past(int Y, int M, int D) {
  int day = 0;
  REP(i, 1, Y) {
    if(i % 3 == 0) day += 10 * 20;
    else day += 19 * 5 + 20 * 5;
  }
  REP(i, 1, M) {
    if(Y % 3 == 0) {
      day += 20;
    } else {
      if(i % 2 == 1) day += 20;
      else day += 19;
    }
  }
  day += D;
  return day;
}

int main(void) {
  int N; cin >> N;
  int m = past(1000, 1, 1);
  REP(i, 0, N) {
    int Y, M, D; cin >> Y >> M >> D;
    cout << (m - past(Y, M, D)) << endl;
  }

  return 0;
}

Measured memory_bytes: 3096
# -*- coding: utf-8 -*-

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    n = [int(e) for e in lines[0].split(" ")][0]

    return (n, )


def solve(n):

    result = "No"
    for i in range(1, 10):
        for j in range(1, 10):
            if n == i * j:
                result = "Yes"
                break
        if result == "Yes":
            break

    return  result


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
	

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string str = Console.ReadLine();
		int A = int.Parse(str);
		string str2 = Console.ReadLine();
		int B = int.Parse(str2);
		string str3 = Console.ReadLine();
		int C = int.Parse(str3);
		string str4 = Console.ReadLine();
		int X = int.Parse(str4);
		int count = 0;
		for(var i=0;i<=A;i++){
			for(var j=0;j<=B;j++){
				int t = X-i*500-j*100;
				if(t < 0){
					break;
				} else if(t % 50 == 0 && t / 50 <= C) {
					count += 1;
				}
			}
		}
		Console.WriteLine(count);
	}
}

Measured memory_bytes: 11092
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
	double a, b, c, d, e, f;
	while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF)
	{
		double x = (f-c*e/b)/(d-e*a/b);
		x = -0.001 < x && x <= -0 ? x = 0 : x;
		double y = (c-a*x)/b;
		printf("%.3f %.3f\n", x, y);
	}

	return 0;
}

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

using namespace std;

#define lli long long int

unordered_map<lli, lli> M;
vector<int> V;

int main() {
    int N; cin >> N; V.resize(N);
    for(int i = 0; i < N; i++) {
        lli temp; cin >> temp;
        M[temp]++;
        V[i] = temp;
    }

    lli answer = 0;
    for(auto it = M.begin(); it != M.end(); it++) {
        answer += (it->second * (it->second - 1)) >> 1;
    }

    for(auto v : V) {
        lli temp = (M[v] * (M[v]-1)) >> 1;
        lli tt = M[v]-1;
        lli res = answer - temp + ((tt * (tt - 1)) >> 1);
        cout << res << "\n";
    }
    

    return 0;   
}

Measured memory_bytes: 8392
/*
          , -- 、
        /;;;;;;', 　　　
        i二二二i
      , ' 　    ヽ ???
     i　ﾉﾉﾉﾉﾉﾍ .', 　　
     〉ﾘi' ﾟ ヮﾟﾉﾚく　 WAyon..........
  ○⊂}〈lﾄ--ｲl〉{つ● 　　
      ,ｒ/ー i-ヽヽ 　　　
     ｀｀i_ﾗi_ﾗ
*/



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

const int INF=(long long)1e12;
const int mod=(int)1e9+7;
#define all(a) (a).begin(),(a).end()
typedef vector<vector<int>> graph;
int sz=262144;complex<double> y[262160],A[262160],B[262160];

void dft(complex<double> *x,bool inv);
#define P pair<int,int>





signed main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int a,b,c,n,m;string s;
    cin>>s;
    cout <<(s[2]==s[3]&&s[4]==s[5]?"Yes":"No")<<endl;
}

void dft(complex<double> *x,bool inv){
    for(int i=sz>>1;i>=1;i>>=1){
        complex<double> zeta=polar(1.0,2.0*acos(-1)*i/sz*(inv?-1.0:1.0)),now=1;
        for(int j=0;2*j<sz;j+=i){//i飛ばし
            rep(k,i) {
                y[k+j]=x[2*j+k]+now*x[2*j+i+k];
                y[j+k+(sz/2)]=x[2*j+k]-now*x[2*j+i+k];//sz/2以上のやつ。原点対称を利用
            }
            now*=zeta;
        }
        rep(i,sz)x[i]=y[i];//探索の区間の幅を狭める前にこぴー
    }

    if(inv)rep(i,sz)x[i]/=sz;

}

Measured memory_bytes: 256
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <iterator>
#include <algorithm>
#include <cfenv>
#include <random>
#include <numeric>
#include <cmath>
#include <iosfwd>
#include <iostream>
#include <ios>
#include <streambuf>
#include <istream>
#include <ostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <bitset>
#include <climits>

#define SIZE 200001
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
    ll x[2],y[2];
    cin >> x[0] >> x[1] >> y[0] >> y[1];
    ll ans = LLONG_MIN;
    for(int i = 0 ; i < 2 ; i++){
        for(int j = 0 ; j < 2 ; j++){
            if(ans < x[i]*y[j]){
                ans = x[i]*y[j];
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int A[100010];
int main()
{
	int N, K;
	cin >> N >> K;
	for (int i = 0; i < N; i++) cin >> A[i];
	cout << (N - 1 + K - 1 - 1) / (K - 1) << endl;
}

Measured memory_bytes: 3984
#from collections import deque,defaultdict
from sys import stdin
input = stdin.readline
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n = inn()
a = inl()
a.sort()
b = [True]*(a[n-1]+1)
ans = 0
for i in range(n):
    x = a[i]
    if not b[x]:
        continue
    if not (i<n-1 and a[i+1]==a[i]):
        ans += 1
    for j in range(x,a[n-1]+1,x):
        b[j] = False
print(ans)


Measured memory_bytes: 106136
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()


def main():
	n=II()
	A=[II() for _ in range(5)]
	print(5+(n-1)//min(A))









if __name__ == "__main__":
	main()


Measured memory_bytes: 62088
#include<stdio.h>

int main(void){
  int a,b;
  scanf("%d %d",&a,&b);
  if(a<b){
    printf("a < b\n");
  }else	if(a>b){
    printf("a > b\n");
  }else{
    printf("a == b\n");
  }

  return 0;
}


Measured memory_bytes: 2132
#include <bits/stdc++.h>
using namespace std;
int main(void){
  long l,r;
  long m=2018;
  cin>>l>>r;
  r=min(r,l+2019);
  for(long i=l;i<r;i++){
    for(long j=i+1;j<=r;j++){
  	  long x= (i*j)%2019;
      m=min(x,m);
  	}
  }
  cout<<m<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
long double const pi = std::acos(-1.0L);
typedef pair<int,int> P;
const int INF = 1001001001;

bool G[10][10];

int main() {
  int n,m; cin >> n >> m;
  rep(i,m){
    int a, b; cin >> a >> b; --a,--b;
    G[a][b] = G[b][a] = true;
  }

  vector<int> ord(n);
  rep(i,n) ord[i] = i;
  int res = 0;
  do{
    if(ord[0] != 0) break;

    bool ok = true;
    rep(i,n-1){
      int from = ord[i];
      int to = ord[i+1];
      if(!G[from][to]) ok = false;
    }
    if(ok) ++res;
  }while(next_permutation(ord.begin(), ord.end()));

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

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

using namespace std;

#define ge getchar()
#define Re read()

inline int read() {
    int x; scanf("%d", &x);
    return x;
}

const int MAXN = 200100;
const int MAXV = 1000100;
const int mod = 998244353;

inline void Add(int&x, int y) { x += y, x -= x >= mod ? mod : 0; }
inline int Mod(int x) { return x >= mod ? x - mod : x; }

template<typename T>
inline void chkmax(T&a, T b) { a = a > b ? a : b; }

int a_1[MAXV + 1];
int a_2[MAXV + 1];
int f_d[MAXV + 1];

int tot;
int pri[MAXV + 1];
int miu[MAXV + 1];
int inv[MAXV + 1];
int chk[MAXV + 1];
int F[MAXV + 1];

inline void init(int mx) {
	inv[1] = 1, miu[1] = 1;
	for(int i = 2; i <= mx; i++) {
		inv[i] = 1LL * (mod - mod / i) * inv[mod % i] % mod;
		if(!chk[i]) pri[++tot] = i, miu[i] = mod - 1;
		for(int j = 1; j <= tot; j++) {
			if(i * pri[j] > mx) break;
			chk[i * pri[j]] = 1;
			if(i % pri[j] == 0) break;
			miu[i * pri[j]] = mod - miu[i];
		}
	}
	for(int i = 1; i <= mx; i++) {
		for(int j = i << 1; j <= mx; j += i)
			Add(a_1[i], a_1[j]), Add(a_2[i], a_2[j]);
		f_d[i] = 1LL * (1LL * a_1[i] * a_1[i] - a_2[i] + mod) % mod * inv[2] % mod;
	}
}

int main() {
	int n = Re, N = 0;
	for(int i = 1; i <= n; i++) {
		int v = Re;
		chkmax(N, v); Add(a_1[v], v);
		Add(a_2[v], 1LL * v * v % mod);
	} init(N); int res = 0;
	for(int d = 1; d <= N; d++) {
		for(int T = d, t = 1; T <= N; T += d, ++t) {
			Add(res, 1LL * inv[d] * miu[t] % mod * f_d[T] % mod);
		}
	} printf("%d\n", res);
	return 0;
}


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

vector<int> memo(45,-1);
int fib(int n){
    if(n==0||n==1) return 1;
    if(memo.at(n)!=-1) return memo.at(n);
    return memo.at(n)=fib(n-1)+fib(n-2);
}

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


Measured memory_bytes: 3108
#include<bits/stdc++.h>
using namespace std;
long long int dp[100001][3];
int main()
{
    int n;
    cin>>n;
    vector<vector<int>>arr(n,vector<int>(3));
    for(int i=0;i<n;i++)
    {
        cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
    }
    //input part has been done
    //now initialization for day 1
    dp[1][0]=arr[0][0];
    dp[1][1]=arr[0][1];
    dp[1][2]=arr[0][2];
    for(int i=2;i<=n;i++)
    {
        dp[i][0]=arr[i-1][0]+max(dp[i-1][1],dp[i-1][2]);

        dp[i][1]=arr[i-1][1]+max(dp[i-1][0],dp[i-1][2]);

        dp[i][2]=arr[i-1][2]+max(dp[i-1][1],dp[i-1][0]);
    }
    long long int ans=max(dp[n][0],max(dp[n][1],dp[n][2]));
    cout<<ans<<endl;
}


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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]B - 仲良しうさぎ / Friendly Rabbits
            int N = int.Parse(Console.ReadLine());
            var a = GetRabbits();
            int pairs = 0;

            for(int i = 0; i < N; i++)
            {
                if (a[i] >= 0)
                {
                    if (a[a[i]] == i)
                    {
                        pairs++;
                        a[a[i]] = -1;
                    }
                }                
            }

            Console.WriteLine(pairs);
        }

        static int[] GetRabbits()
        {
            var line = Console.ReadLine();
            var arr = line.Split(' ');

            return arr.Select(x => int.Parse(x) - 1).ToArray();
        }
    }
}

Measured memory_bytes: 18912
#include<bits/stdc++.h>
#include<string>
typedef long long ll;
#define  fi0(i,n)  for(int i=0;i<n;i++)
#define   pb()    push_back()
#define   mk()    make_pair()
#define   fst      first
#define   scnd    second
#define   fast    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define   endl     '\n';
using namespace std;
ll d(ll i)
{
}
void solve()
{
   int t;cin>>t;int k=1;while(t--){
   double t_r,r,b;
   cin>>t_r>>r>>b;
    double c_r,r_r;
   if(t_r<=r){
      r_r=0;
   }
   else{
      double d=t_r-r+1;
      r_r=d/(b/6);
   }
    b=300-b;
    if(b<=0){
      c_r=0;
    }
    else{
      c_r=(r)/(b/6);
    }
    cout<<setprecision(2)<<fixed<<c_r<<' '<<r_r<<endl;
}
}
void f()
{
    vector<string>xxx;
    cin.ignore();
    string s,test;
    getline(cin,s);
    reverse(s.begin(),s.end());
    for(int i=0; i<s.size(); i++)
    {
        if(i==s.size()-1)
        {
            test+=s[i];
            xxx.push_back(test);
            break;
        }
        if(s[i]!=' ')
        {
            test+=s[i];
        }
        else if(s[i]==' ')
        {
            xxx.push_back(test);
            test="";
        }
    }
    for(int i=0; i<xxx.size(); i++)
    {
        reverse(xxx[i].begin(),xxx[i].end());
        cout<<xxx[i]<<' ';
    }
}
void ff()
{
    int terget,run,ball;
    cin>>terget>>run>>ball;
    int r_run=terget-run+1;
    double over=50-(double)(ball)/6;
    double c_r_r=(double) run/over;
    double r_r_r=r_run/((double)(ball)/6);

    cout<<setprecision(2)<<fixed<<c_r_r<<' '<<r_r_r<<endl;
}
void mrge(int *arr,int low,int mid,int high){
    int i=low,k=low,j=mid+1,test[high];
    while(i<=mid&&j<=high){
      if(arr[i]<arr[j]){
        test[k++]=arr[i++];
      }
      else{
        test[k++]=arr[j++];
      }
    }
    while(i<=mid){
      test[k++]=arr[i++];
    }
    while(j<=high)test[k++]=arr[j++];
    for(int i=low;i<=high;i++)arr[i]=test[i];
}
void srt(int *arr,int low,int high){
  int mid;
   if(low<high){
  mid=(low+high)/2;
  srt(arr,low,mid);
  srt(arr,mid+1,high);
  mrge(arr,low,mid,high);
   }
   else return;
}
bool isprime(ll n){
  bool x=0;
  if(n==1)return x;
  for(int i=2;i*i<=n;i++){
    if(!(n%i))return x;
  }
  return !x;
}
vector<ll>save(){
      vector<ll>a;
      for(ll i=2;i<=100000;i++){
      if(isprime(i))a.push_back(i);
    }
    return a;
}
ll n=100007;
bool sa[100007];
void saive(){
    sa[2]=1;
    for(ll i=3;i<=n;i+=2){
            bool x=0;
        for(ll j=2;j*j<=i;j++){
            if(i%j==0){x=1;break;}
        }
        if(!x){sa[i]=1;}
    }
}
int main()
{
    fast;
    int n;cin>>n;
  cout<<!n<<endl;
}


Measured memory_bytes: 3616
import math

A, B, H, M = map(int, input().split())

arg = abs(30*H - 5.5*M)
if arg > 180:
  arg = 360 - arg
#print(arg)    
arg = math.radians(arg) 
#print(math.cos(arg))
print((A**2 + B**2 -2*A*B*math.cos(arg))**0.5)

Measured memory_bytes: 9500
#include <stdio.h>
#pragma warning <disable:4996>

int main(void){
    int A, B;
        printf(" ");
        scanf("%d", &A);
        printf(" ");
        scanf("%d", &B);
        if(A<1){
            return 0;
        }else if(A>100){
            return 0;
        }else if(B<0){
            return 0;
        }else if(B>100){
            return 0;
        }else{
            int C = A*B;
            printf("%d\n", C);
        }
}


Measured memory_bytes: 1708
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
#define MAX 50
#define NMAX 80

class Node{
    public:
    vector<int> adjList;
    Node(){}
    void insert( int i ){ adjList.push_back(i);}
};

class Network{
    public:
    vector<Node> nodes;
    Network(){}

    int size(){ return nodes.size(); }
    void addNode(){ nodes.push_back(Node()); }

    void connect( int i, int j ){
        nodes[i].insert(j); nodes[j].insert(i);
    }

    void addNewNodes( int target, int diff, int u ){
        if ( diff == 1 ){
            connect( target, u );
        } else {
            for ( int i = 1; i < diff; i++ ){
                addNode();
                if ( i == 1 ) connect( target, size()-1 );
                else connect( size()-2, size()-1);
            }
            connect( size()-1, u );
        }
    }
};

class State{
    public:
    int cur, pre, d;
    State(){}
    State(int cur, int pre, int d): cur(cur), pre(pre), d(d){}
};

int N, M[MAX][MAX];
Network network;

int getDistance(int s, int t){
    queue<State> Q;
    Q.push(State(s, -1, 0));
    State u;
    while( !Q.empty() ){
        u = Q.front(); Q.pop();
        if ( u.cur == t ) return u.d;
        for ( int i = 0; i < network.nodes[u.cur].adjList.size(); i++ ){
            int v = network.nodes[u.cur].adjList[i];
            if ( v != u.pre ){
                Q.push(State(v, u.cur, u.d + 1));
           }
        }
    }
}

int parse( int source, int end ){
    int pre = M[end+1][0] - getDistance( source, 0 );
    int d;
    for ( int t = 1; t <= end; t++ ){
        d = M[end+1][t] - getDistance( source, t );
        if ( pre != d ) return -1;
    }
    return pre;
}

void addNewNode( int u ){
    for ( int target = N; target < network.size(); target++ ){
        int diff = parse(target, u - 1);
        if ( diff > 0 ) {
            network.addNewNodes(target, diff, u);
            return;
        }
    }
}

void solve(){
    network = Network();
    for ( int i = 0; i < N + 1; i++ ) network.addNode();
    network.connect( 0, network.size()-1);

    for ( int i = 1; i < N; i++ ) addNewNode(i);

    vector<int> degree;
    for ( int i = N; i < network.size(); i++ ) {
        degree.push_back(network.nodes[i].adjList.size());
    }
    sort(degree.begin(), degree.end());
    for ( int i = 0; i < degree.size(); i++ ){
        if ( i ) cout << " ";
        cout << degree[i];
    }
    cout << endl;
}

bool input(){
    cin >> N;
    if ( N == 0 ) return false;
    for ( int i = 0; i < N; i++ ){
        for ( int j = 0; j < N; j++ ) cin >> M[i][j];
    }
    return true;
}
 main(){
    while ( input() ) solve();
 }

Measured memory_bytes: 1296
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

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

        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int[] l = new int[N];
        for (int i = 0; i < l.length; ++i) {
            l[i] = sc.nextInt();
        }

        System.out.println(solve(l, A, B, C));

        sc.close();
    }

    static int solve(int[] l, int A, int B, int C) {
        int[] targets = { A, B, C };

        int result = Integer.MAX_VALUE;
        for (int code = 0; code < (1 << (2 * l.length)) - 1; ++code) {
            int[] counts = new int[3];
            int[] sums = new int[3];
            int[] groups = decode(l.length, code);
            for (int i = 0; i < l.length; ++i) {
                if (groups[i] != 3) {
                    ++counts[groups[i]];
                    sums[groups[i]] += l[i];
                }
            }

            if (Arrays.stream(counts).allMatch(count -> count != 0)) {
                result = Math.min(result,
                        IntStream.range(0, 3).map(i -> (counts[i] - 1) * 10 + Math.abs(sums[i] - targets[i])).sum());
            }
        }

        return result;
    }

    static int[] decode(int size, int code) {
        int[] groups = new int[size];
        for (int i = 0; i < groups.length; ++i) {
            groups[i] = code % 4;
            code /= 4;
        }

        return groups;
    }
}

Measured memory_bytes: 60520
from fractions import gcd

def lcm(a,b):
    return a * b // gcd(a,b)
    
a, b, c, d = map(int, (input().split()))

ans = b - a + 1
ans += (b // lcm(c, d) - (a-1) // lcm(c, d))
ans -= (b // c - (a-1) // c) + (b // d - (a-1) // d)

print(ans)

Measured memory_bytes: 5048
/* AOJ 0022 Maximum Sum Sequence */

#include <iostream>
#include <algorithm>
#include <climits>

using namespace std;

void update(int i, int x);
void init();

const int MAX_N = 5000;
const int MIN_A = -100000;

int max_sum[MAX_N + 1];

int
main()
{
    for (;;) {
        int n, i;

        cin >> n;
        if (n == 0) break;

        init();
        for (i = 1; i <= n; i++) {
            int a;

            cin >> a;
            update(i, a);
        }

        cout << *max_element(max_sum + 1, max_sum + n + 1) << endl;
    }

    return 0;
}

void
update(int i, int a)
{
    max_sum[i] = max(max_sum[i - 1] + a, a);
}

void
init()
{
    max_sum[0] = 0;
}

Measured memory_bytes: 1176
#include <bits/stdc++.h>
#define For(i, a, b) for (int(i) = (int)(a); (i) < (int)(b); ++(i))
#define rFor(i, a, b) for (int(i) = (int)(a)-1; (i) >= (int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
T div_floor(T a, T b) {
    if (b < 0) a *= -1, b *= -1;
    return a >= 0 ? a / b : (a + 1) / b - 1;
}
template <class T>
T div_ceil(T a, T b) {
    if (b < 0) a *= -1, b *= -1;
    return a > 0 ? (a - 1) / b + 1 : a / b;
}

constexpr lint mod = 1000000007;
constexpr lint INF = mod * mod;
constexpr int MAX = 100010;

int main() {
    int n;
    scanf("%d", &n);
    int ans = 0;
    For(i, 1, n) ans += (n - 1) / i;
    printf("%d\n", ans);
}

Measured memory_bytes: 3824
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {

			int n = sc.nextInt();
			int m = sc.nextInt();
			// アルバイトできる日、それぞれに日当のリストを持つ
			List<List<Integer>> jobs = new ArrayList<>(m);
			for(int i = 0 ; i < m ; i++) {
				jobs.add(new ArrayList<>());
			}

			// アルバイトを順番にループ
			// ギリギリ期日までに報酬が得られるものを全てListに積む
			for(int i = 0 ; i < n ; i++) {
				int a = sc.nextInt();
				int b = sc.nextInt();
				// 期日までに報酬が得られないものはスルー
				if(m < a) {
					continue;
				}
				List<Integer> rewardList = jobs.get(m - a);
				rewardList.add(b);
			}

			// 優先度付きキューを生成(報酬の大きいものを優先)
			PriorityQueue<Integer> q = new PriorityQueue<>((o1, o2) -> {
				return Integer.compare(o2, o1);
			});

			long value = 0;
			// 期日から1日ずつ前にループ
			for(ListIterator<List<Integer>> ite = jobs.listIterator(jobs.size()) ; ite.hasPrevious() ;) {
				// その日に可能なアルバイトをキューに積む
				for(Integer v : ite.previous()) {
					q.add(v);
				}
				// もっとも優先度の高い報酬を取り出す
				if(!q.isEmpty()) {
					value += q.poll();
				}
			}
			System.out.println(value);

		}
	}

}


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

using namespace std;

int main()
{
    int a, b , c ,d ;
    scanf("%d %d %d %d", &a, &b ,&c ,&d);
    if(a*b>c*d ){
        int first =a*b;
        printf("%d", first);
        }
        else if (a*b<c*d){
        int second =c*d;
           printf("%d", second);
         }
        else if (a*b==c*d){
         int third=a*b;
         printf("%d", third);
        }
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2
 
using namespace std;
int MOD = 1000000007;
signed main(){
    string s;
    cin >> s;
    if(s[0] != 'A'){
        cout << "WA" << endl;
        return 0;
    }
    int cnt = 0;
    for(int i = 2;i < s.size()-1;i++){
        if(s[i] == 'C')cnt++;
    }
    if(cnt != 1){
        cout << "WA" << endl;
        return 0;
    }
    for(int i = 0;i <s.size();i++){
        if(!(s[i] == 'A' || s[i] == 'C' ||(s[i] >= 'a' && s[i] <= 'z' ))){
            cout << "WA" << endl;
            return 0;
        }
    }
    cout << "AC" << endl;
    return 0;   
}

// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl https://abc104.contest.atcoder.jp/tasks/abc104_b
// rm -r -f test;oj dl http://yahoo-procon2017-qual.contest.atcoder.jp/tasks/yahoo_procon2017_qual_c


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

int main(){
    int n,k;
    cin>>n;
    char s[n];
    char nice;
    for(int i=0;i<n;i++){
        cin>>s[i];
    }
    cin>>k;

    nice = s[k-1];

    for(int i=0;i<n;i++){
        if(s[i]!= nice)s[i]='*';
    }

    for(int i=0;i<n;i++){
        cout<<s[i];
    }
    cout<<endl;



    return 0;
}


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

int main() {
	int N;
  	cin >> N;
  	int K;
    int min = 512;
  
		for (int i = 0; i < N; i++) {
          int A;
          cin >> A;
          K = 0;
          
          if (A%2 == 1) {
            min = 0;
            break;
          }
          
          while (A%2 == 0) {
              K++;
              A /= 2;
          }
          
          if (K <= min) min = K;
        }
  
  cout << min << endl;
}


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

class Program
{
    static int[] ReadInts()
        => Console.ReadLine()
            .Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries)
            .Select(s => int.Parse(s))
            .ToArray();

    static void Main(string[] args)
    {
        var s = Console.ReadLine();
        Console.WriteLine(s == "AAA" || s == "BBB" ? "No" : "Yes");
    }
}


Measured memory_bytes: 13140
hash = Hash.new {|hash, key| hash[key] = []}
while (str = gets) != nil
  word, page = str.split
  hash[word] << page.to_i
end
hash.values.each {|item| item.sort!}
hash = Hash[hash.sort]
hash.each {|k, v| puts k, v.join(" ")}

Measured memory_bytes: 8640