akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
using namespace std;
int main(){
  int x, buf, i, j;
  int top[3];
  for(i = 0; i < 3; i++)
    top[i] = 0;

  for(i = 0; i < 10; i++){
    cin >> x;
    if(x > top[2]){
      top[2] = x;
      j = 2;
      while(j > 0){
        if(top[j-1] <top[j]){
          buf = top[j-1];
          top[j-1] = top[j];
          top[j] = buf;
          j--;
        }else{
          break;
        }
      }
    }
  }

  for(i = 0; i<3; i++)
    cout << top[i] << '\n';

  return 0;
}

Measured memory_bytes: 1164
#include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
	string a,b;
	cin>>a>>b;
	if(a.size()>b.size()){
		cout<<"GREATER"<<endl;
		return(0);
	}
	else if(a.size()<b.size()){
		cout<<"LESS"<<endl;
		return(0);
	}
	else{
		for(int i=0;i<a.size();i++){
			if(a[i]>b[i]){
				cout<<"GREATER"<<endl;
				return(0);
			}
			if(a[i]<b[i]){
				cout<<"LESS"<<endl;
				return(0);
			}
		}
	}
	cout<<"EQUAL"<<endl;
	return(0);
}

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

int main(){
  int a[3];
  for(int i = 0;i<3;++i)
    cin >> a[i];

  int max = a[0];
  if (max < a[1]) max = a[1];
  if (max < a[2]) max = a[2];

  cout << a[0] + a[1] + a[2] - max << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using Int = int64_t;
using UInt = uint64_t;
using C = std::complex<double>;
#define rep(i, n) for(Int i = 0; i < (Int)(n); ++i)
#define rep2(i, l, r) for(Int i = (Int)(l); i < (Int)(r); ++i)
#define guard(x) if( not (x) ) continue;
#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif

int main() {
   Int n, m, e;
   std::cin >> n >> m >> e;
   std::vector<Int> ss(1), ts(1), fs(1), bs(1);
   auto addEdge = [&](Int s, Int t, Int f, Int b) {
      ss.emplace_back(s);
      ts.emplace_back(t);
      fs.emplace_back(f);
      bs.emplace_back(b);
   };
   rep(i, e) {
      Int x, y;
      std::cin >> x >> y;
      addEdge(x, n+y, 0, 1);
   }
   Int source = n+m, sink = n+m+1;
   Int v = n + m + 2;
   rep2(i,0,n)   addEdge(source, i, 0, 1);
   rep2(i,n,n+m) addEdge(i, sink, 0, 1);
   std::vector<std::vector<Int>> es(v);
   rep(i, fs.size()) {
      Int s = ss[i], t = ts[i];
      es[s].emplace_back(i);
      es[t].emplace_back(-i);
   }
   Int res = 0;
   for(;;) {
      std::queue<Int> q;
      std::vector<Int> xs(v, -1), ps(v, -1);
      xs[source] = (Int)1<<53;
      q.emplace(source);
      while( not q.empty() ) {
         Int s = q.front(); q.pop();
         for(Int i : es[s]) {
            Int t = i > 0 ? ts[i] : ss[-i];
            Int w = i > 0 ? bs[i] : fs[-i];
            guard( w > 0 and xs[t] == -1 );
            xs[t] = std::min(xs[s], w);
            ps[t] = i;
            q.emplace(t);
         }
      }
      Int tf = xs[sink];
      if( xs[sink] <= 0 ) break;
      for(Int i=sink, k=ps[i]; i!=source; i=k>0?ss[k]:ts[-k], k=ps[i]) {
         if( k > 0 ) {
            fs[k] += tf;
            bs[k] -= tf;
         }
         else {
            fs[-k] -= tf;
            bs[-k] += tf;
         }
      }
      res += tf;
   }
   printf("%ld\n", res);
}



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

#define rep(i,n) for(int i=0; i<(n); i++)
#define repi(i,a,b) for(int i = (a); i<= (b); i++)
#define repA(i,n) for(int i = (n); i>=0; i--)
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (int)(a.size())

typedef long long ll;
typedef long double ld;
const ll mod = (ll)(1e9+7);//998244353;
const int N = (int)(1e5+5);

void pre() {
  ios::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  //freopen("output.txt","w",stdout);
  #endif
}

void solve() {
  int n; ll d;  cin>>n>>d;
  int cnt = 0;
  rep(i,n) {
    ll x,y; cin>>x>>y;
    if((x*x + y*y) <= (d*d))  cnt++;
  }
  cout<<cnt;
}

int main() {
  pre();
  int t = 1;
  //cin>>t;
  rep(i,t)  {
    //cout<<"Case #"<<(i+1)<<"\n";
    solve();
    cout<<'\n';
  }
  return 0;
}


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

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILLl(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_dimension_size),value)
#define FILL(n,first_dimension_size,value) fill((int*)n,(int*)(n+first_dimension_size),value)
#define INF (1 << 29)
#define MOD 1000000007
//int dx[4] = {1,0,0,-1};
//int dy[4] = {0,1,-1,0};

int binary_search(vector<int> &v,int l){
  int left = -1,right = v.size();
  while(right - left > 1){
    int mid = (left+right)/2;
    if(v[mid] >= l)right = mid;
    else left = mid;
  }
  return right;
}

int binary_search_d(vector<int> &v,int r){
  int left = -1,right = v.size();
  while(right - left > 1){
    int mid = (left+right)/2;
    if(v[mid] > r)right = mid;
    else left = mid;
  }
  return left;
}

int main(){

  int n,q;
  string s;
  vector<int> v;
  cin >> n >> q >> s;
  REP(i,n-1){
    if(s[i] == 'A' && s[i+1] == 'C')v.push_back(i);
  }
  REP(i,q){
    
    int l,r;cin >> l >> r;
    if((int)v.size() == 0){
      cout << 0 << endl;
      continue;
    }
    l--,r--;
    int ll = binary_search(v,l),rr = binary_search_d(v,r-1);
    if(ll == v.size() || rr == -1){
      cout << 0 << endl;
      continue;
    }
    if(v[rr] > r && rr != ll)rr--;
    cout << rr - ll +1 << endl;
  }


  return 0;
}


Measured memory_bytes: 1404
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod;
		}
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2) % mod;
}
/*--------Library Zone!--------*/

int n, d;
int a[15][15];
signed main() {
	cin >> n >> d;
	rep(i, n)rep(j, d)cin >> a[i][j];
	int ans = 0;
	rep(i, n) {
		for (int j = i + 1; j < n; j++) {
			int memo = 0;
			rep(k, d) {
				memo += (a[i][k] - a[j][k]) * (a[i][k] - a[j][k]);
			}
			for (int k = 1; k * k <= memo; k++) {
				if (memo == k * k) {
					ans++;
				}
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<map>
#include<set>
#include<queue>

using namespace std;

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(a) (a).begin(),(a).end()
#define PI 3.141592653589793238
#define INF 1050000000
#define INFL (long long)(4e18)

using vi = vector<int>;

template<class T>
struct Edge {
    int to;
    T cost;
    Edge() {};
    Edge(int to, T cost) : to(to), cost(cost) {};
};

template<class T>
class Graph {
    int n;
    bool directed;
    vector<vector<Edge<T>>> edges;
public:

    Graph(int n, bool directed) :n(n), directed(directed), edges(vector<vector<Edge<T>>>(n)){};
    Graph() {};

    void add(int from,int to, T cost) {
        edges[from].emplace_back(to, cost);
        if(!directed){
            edges[to].emplace_back(from,cost);
        }
    }

    int size() {
        return n;
    }
};


int main() {

    int N;

    cin >> N;

    int ans;

    ans = N-1;
    bool flag = true;

    while(flag){
        flag = false;
        ans++;
        FOR(i,2,ans){
            if(ans % i == 0)flag = true;
        }

    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import math
 
A, B, N = map(int, input().split())
 
 
ans1 = 0
 
if N > B - 1:
    x = B-1
    print(int((A * x) / B) - A * int(x / B))
elif N <= B - 1:
    x = N
    print(int((A * x) / B) - A * int(x / B))

Measured memory_bytes: 9124
#include <iostream>
using namespace std;
int main(){
    int n,i,x,a,b;
    char ch;
    cin>>n;
    int cards[5][14];
    for(a=1;a<=4;a++){
        for(b=1;b<=13;b++){
            cards[a][b]=0;
        }
    }
    for(i=1;i<=n;i++){
        cin>>ch>>x;
        if(ch=='S'){
            cards[1][x]=1;
        }
        else if(ch=='H'){
            cards[2][x]=1;
        }
        else if(ch=='C'){
            cards[3][x]=1;
        }
        else if(ch=='D'){
            cards[4][x]=1;
        }
    }
    for(a=1;a<=4;a++){
        for(b=1;b<=13;b++){
            if(cards[a][b]==0){
                if(a==1){
                    cout<<'S'<<" "<<b<<endl;
                }
                else if(a==2){
                    cout<<'H'<<" "<<b<<endl;
                }
                else if(a==3){
                    cout<<'C'<<" "<<b<<endl;
                }
                else if(a==4){
                    cout<<'D'<<" "<<b<<endl;
                }
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3108
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))


#処理内容
def main():
	N, T = getlist()
	K = []
	for i in range(N):
		A, B = getlist()
		K.append([A, B])
	DP = [[0 for i in range(T)] for j in range(N + 1)]
	for i in range(N):
		W, V = K[i][0], K[i][1]
		for j in range(T):
			if j < W:
				DP[i + 1][j] = DP[i][j]
			else:
				DP[i + 1][j] = max(DP[i][j], DP[i][j - W] + V)
	ans = DP[-1][-1]
	use = [0] * N
	Y = T - 1
	for i in range(N):
		if DP[N - i][Y] != DP[N - i - 1][Y]:
			use[N - 1 - i] = 1
			Y -= K[-1 - i][0]
	lis = []
	for i in range(N):
		if use[i] == 0:
			lis.append(K[i][1])
	lis = sorted(lis)
	if len(lis) >= 1:
		ans += lis[-1]
	print(ans)

if __name__ == '__main__':
	main()

Measured memory_bytes: 120924
#include <stdio.h>

int main(void){
    int n;
    long long unsigned val=0;
    
    scanf("%d", &n);
    for (int i=0; i<n; i++){
        int tmp;
        scanf("%d", &tmp);
        val += tmp;
    }
    val /= n;
    printf("%d\n", val);
    
    return 0;
}

Measured memory_bytes: 2756
#include <bits/stdc++.h>
#define rep( i, n ) for (long long i = 0; i < ( long long )(n); i++)

using namespace std;
typedef long long ll;
typedef pair< int , int > P;
typedef tuple<int, int, int> T;


int main(){
  ll n;

  cin>>n;

  vector<ll> a(n);
  vector<ll> b(n,0);
  for(ll i = 1;i<n;i++){
    cin>>a.at(i);
  }

  for(ll i = 1;i<n;i++){
    ll c=a.at(i)-1;
    b.at(c)++;
  }
  rep(i,n){
    cout<<b[i]<<endl;
  }
}

Measured memory_bytes: 6428
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

#debug = True
debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    l = input().rstrip('\n')
    n = len(l)
    # 制約1 a+b は L 以下
    # 制約2 a と b で同じけたは 00 01 10 のいずれか

    mx = 10**9 + 7
    same = 1 # iまでの a+b が l と等しい（a+b <= L となるかは次の桁で気をつける必要あり）
    diff = 0 # iまでの a+b が l と異なっている（すでに a+b <= L が確定）

    for i in range(n):
        if l[i] == "1":
            same_tmp = same * 2
            diff_tmp = same * 1 + diff * 3
        else:
            same_tmp = same * 1
            # diff_tmp = same * 2 + diff * 3 ×sameで次の桁が0の場合、次の桁を1にはできない
            diff_tmp = diff * 3
        same = same_tmp % mx
        diff = diff_tmp % mx

        dprint(i, l[i], same, diff)

    print((same + diff) % mx)

solve()

Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define vec vector
#define vi vec<int>
#define vvi vec<vec<int>>
#define ALL(a) begin(a), end(a)
#define RALL(a) rbegin(a), rend(a)
#define SORT(a) stable_sort(ALL(a))
#define RSORT(a) stable_sort(RALL(a))
#define REV(a) reverse(ALL(a))
#define UNIQUE(a) a.erase(unique(ALL(a)), end(a))
#define lambda(i) [=](auto i)
#define compare(i, j) [=](auto i, auto j)
#define min_of(a) *min_element(ALL(a))
#define max_of(a) *max_element(ALL(a))
#define sum(a) accumulate(ALL(a), 0)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define SZ(a) (int)(a).size()
#define REP(i, n) for (decltype(+n) i = 0; i < (n); i++)
#define RREP(i, n) for (auto i = n - 1; i != static_cast<decltype(i)>(-1); i--)
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define RFOR(i, a, b) for (auto i = b - 1; i != a; i--)
#define EACH(i, a) for (auto&& i: (a))
using namespace std;

const int INF = 1e18;
const int MOD = 1e9 + 7;
int mod_add(int A, int B) { return (A + B) % MOD; }
int mod_sub(int A, int B) { return (A + MOD - B) % MOD; }
int mod_mul(int A, int B) { return ((A % MOD) * (B % MOD)) % MOD; }
int mod_bipow(int X, int Y) {
    if (Y == 0) return 1;
    else if (Y == 1) return X % MOD;
    else if (Y % 2 == 0) {
        int Z = mod_bipow(X, (int)(Y / 2));
        return mod_mul(Z, Z);
    } else {
        int Z = mod_bipow(X, (int)(Y / 2));
        return mod_mul(mod_mul(Z, Z), X);
    }
}
int mod_inv(int X) { return mod_bipow(X, MOD - 2); }
int mod_div(int A, int B) { return mod_mul(A, mod_inv(B)); }

int ceil_div(int X, int Y) {
  return (X - 1) / Y + 1;
}

struct vertex {
  vector<int> adj = vi(0);
};

struct union_find {
  vi data;
  union_find(int size) : data(size, -1) { }
  bool union_set(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool find_set(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  int size(int x) {
    return -data[root(x)];
  }
};

vi cum(vi V) {
  vi U(SZ(V));
  partial_sum(ALL(V), begin(U));
  return U;
}

void solve() {
  int n;
  int ans = 0;

  cin >> n;
  vi a(n);
  REP(i, n) {
    cin >> a[i];
  }
  SORT(a);
  int index = lower_bound(ALL(a), (a[n - 1] + 1) / 2) - begin(a);
  if (index > 0) {
    ans = abs(a[index] - (a[n - 1] + 1) / 2) > abs(a[index - 1] - a[n - 1] / 2)
      ? index - 1 : index;
  }
  if(ans == n - 1)ans--;


  cout << a[n - 1] << " " << a[ans] << endl;
}

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(15);
  solve();
}


Measured memory_bytes: 1408
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <cstring>
#include <string>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
using namespace std;

#define pb push_back
#define All(a) a.begin(), a.end()
#define met(a, b) memset(a, b, sizeof(a))
#define rep1(i, l, r) for(int i = l; i <= r; ++i)
#define rep2(i, l, r) for(int i = l; i < r; ++i) 
#define per(i, r, l) for(int i = r; i >= l; --i)
typedef long long ll;
typedef double db;
typedef long double ldb;
const int NIL = -1;
const int oo = 0x3f3f3f3f;
const ll INF = 2e18;
const db eps = 1e-8;
const db PI = acos(-1.0);
const int maxn = 200;

int T[maxn];
int n;

inline int read(void)
{
	int x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9')	{ if(ch == '-') f = -1; ch = getchar(); } 
	while(ch >= '0' && ch <= '9') {	x = (x << 1) + (x << 3) + ch - '0';	ch = getchar();	}
	return x * f;
}

inline void write(int x)
{
	if(x < 0) { putchar('-'); x = -x; }
    if(x>=10) write(x/10); 
	putchar(x%10+'0'); 
}

int calc(int x)
{
	int res = 0;
	rep1(i, 1, n)
	{
		res += (T[i] - x) * (T[i] - x);
	}
	return res;
}

int main(void)
{
	n = read();
	int l = oo, r = -oo;
	int ans = oo;
	rep1(i, 1, n)
	{
		T[i] = read();
		l = min(l, T[i]);
		r = max(r, T[i]);
	}
	rep1(i, l, r)
	{
		ans = min(ans, calc(i));
	}
	cout<<ans;
	
	return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>
#include <numeric>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <tuple>

using ll = long long int;
using ul = unsigned long long int;
const ll LL_MAX (1LL<<60);
const ll MOD (1000000007);

#define rep(i,s,e) for(ll i=(s); i<(e); i++) 

using namespace std;

using T = tuple<ll,ll>;
using Graph = vector<vector<T>>;

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

    ll a;
    double b;
    cin >> a >> b;

    ll bb = b * 100 + 0.5; 
    a *= bb;

    cout << a/100 << endl;

    return 0;
}


Measured memory_bytes: 3728
while True:
	n = input()
	if n == 0: break
	board = [[0] * n for i in range(n)]
	xp = n / 2
	yp = n / 2 + 1
	for i in range(n ** 2):
		if board[yp][xp] == 0:
			board[yp][xp] = i + 1
		else:
			xp -= 1
			yp += 1
			if xp == -1: xp = n - 1
			if yp == n : yp = 0
			board[yp][xp] = i + 1
		yp += 1
		xp += 1
		if xp == n: xp = 0
		if yp == n: yp = 0
	for b in board:
		print "".join(map(lambda x:str("% 4d" % x), b))

Measured memory_bytes: 4248
#include<stdio.h>
#include<string.h>
 
#define R 1000000
#define L 12
 
char H[R][L];
 
int getChar(char ch){
  if ( ch == 'A') return 1;
  else if ( ch == 'C') return 2;
  else if ( ch == 'G') return 3;
  else if ( ch == 'T') return 4;
  return 0;
}
 
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i=0; i<strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}
 
int h1(int key){ return key % R; }
int h2(int key){ return 1+(key % (R-1)); }
 
int find(char str[]){
  long long key,i,h;
  int x,y;
  
  key=getKey(str);
  x=h1(key);
  y=h2(key);
 
  for(i=0; i<R; i++){
    h=(x + i * y) % R;
    if(strcmp(H[h],str)==0) return 1;
    else if(strlen(H[h])==0) return 0;
  }
   
  return 0;
}
 
int insert(char str[]){
  long long key,i,h;
  int x,y;
  
  key=getKey(str);
  x=h1(key);
  y=h2(key);
 
  for(i=0; i<R; i++){
    h=(x + y * i) % R;
    if(strcmp(H[h],str)==0)return 1;
    else if(strlen(H[h])==0){
      strcpy(H[h],str);
      return 0;
    }
  }
   
  return 0;
}
 
int main(){
    int i, n, h;
    char str[L], com[9];
    for ( i = 0; i < R; i++ ) H[i][0] = '\0';
     
    scanf("%d", &n);
     
    for ( i = 0; i < n; i++ ){
    scanf("%s %s", com, str);
     
    if ( com[0] == 'i' )
        insert(str);
    else {
        if (find(str))
          printf("yes");
        else 
         printf("no");
     puts("");
    }

    }
 
    return 0;
}




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

int n;
int a[205];
bool dp[105][10005];

int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    dp[0][0]=1;
    for(int i=1;i<=n;i++)
    {
        dp[i][0]=1;
        for(int j=1;j<=10005;j++)
        {
            dp[i][j]|=dp[i-1][j];
            if(j-a[i]>=0)
                dp[i][j]|=dp[i-1][j-a[i]];
        }
    }

    for(int j=10000;j>=0;j--)
    {
        if(j==0)
        {
            printf("0\n");
            return 0;
        }
        if(j%10==0)continue;
        if(dp[n][j])
        {
            printf("%d\n",j);
            return 0;
        }
    }

    return 0;
}


Measured memory_bytes: 1280
#include <iostream>

using namespace std;

int main(void)
{
    int a, b, c, cnt = 0;
    
    cin >> a
        >> b
        >> c;
    while (a <= b) {
        if (c % a == 0) {
            ++cnt;
        }
        ++a;
    }
    cout << cnt << endl;
    
    return 0;
}


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

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int f(int a) {
  return (a * a + 4) / 8;
}

ll memo[1000];
ll fib(ll n) {
  if(n == 0) return 2;
  else if(n == 1) return 1;
  else if(memo[n]) return memo[n];
  else return memo[n] = fib(n-1) + fib(n-2);
}

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

  string s, t; cin >> s >> t;
  sort(s.begin(), s.end());
  sort(t.rbegin(), t.rend());

  cout << (s < t ? "Yes" : "No") << endl;
  
}


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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1; 
    for(int T = 0; T < t ; T++){
        char a;
        cin >> a;
        if(a >= 'A' && a <= 'Z')
            std::cout << "A" << std::endl;
        else
            cout << "a" << endl;
       
    }
    return 0;
}

Measured memory_bytes: 3644
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < n; i++)

using namespace std;

void solve() {
  long foo = 2;
  long bar = 1;
  long baz;

  long N;
  cin >> N;

  while (N--) {
    baz = foo + bar;
    foo = bar;
    bar = baz;
  }

  cout << foo << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>

using namespace std;

int main(){

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

	double n=0.0;
	cin >> n;

	double tmp = n/3;

	//cout <<"tmp="<<tmp<<" "<<endl;
	double t = tmp*2;
	//cout <<n-t<<endl;
	double v = tmp * tmp * (n-t); 

	
	//v = round(v);
	cout << fixed << setprecision(12) << v;



	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <queue>
#include <algorithm>

using namespace std;

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

int main() {
    int N, K;
    int h[101000];
    cin >> N >> K;

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

    int res = 0;
    for(int i = 0; i < N; i++){
        if(h[i] >= K){
            res++;
        }
    }

    cout << res << endl;


    return 0;
}

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

public class Main {
	static int FLOW;
	static int MAX_V = 400000;
	
	public static void main(String[] args) throws IOException {
		FastScanner sc = new FastScanner(System.in);
		
		int N = sc.nextInt();
		int[] A = new int[N];
		HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
		for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
			Integer count = map.get(A[i]);
			if(count == null) map.put(A[i], 1);
			else map.put(A[i], count+1);
		}
		Arrays.sort(A);
		
		int ans = 0;
		for(int i = N-1; i >= 0; i--){
			Integer count = map.get(A[i]);
			if(count == 0) continue;
			
			map.put(A[i], count-1);
			int p = 1;
			while(p <= A[i]) p *= 2;
			p -= A[i];
			Integer count2 = map.get(p);
			if(count2 == null || count2 == 0) continue;
			ans++;
			map.put(p, count2-1);
		}
		
		System.out.println(ans);
	}
}

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
    	if (hasNextByte()) return buffer[ptr++];
    	else return -1;
    }
    private static boolean isPrintableChar(int c){
    	return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
    	while(hasNextByte() && !isPrintableChar(buffer[ptr]))
    		ptr++; return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
}


Measured memory_bytes: 53616
import sys
N=int(input())
A=list(map(int,input().split()))
flag=True
for i in range(N):
    if A[i]%2==0:
        if A[i]%3!=0 and A[i]%5!=0:
            flag=False
if flag==True:
    print('APPROVED')
else:
    print('DENIED')

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define int ll
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
typedef long long ll;
typedef pair<int,int> pii;
#define Rep(i,a,b) for(register int i=(a);i<=int(b);++i)
#define Dep(i,a,b) for(register int i=(a);i>=int(b);--i)
#define rep(i,a,b) for(register int i=(a);i<int(b);++i)
#define mem(x,v) memset(x,v,sizeof(x))
/*inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}*/
#define gc getchar
#define pc putchar
#define fi first
#define se second
#define debug(x) cout << #x" = " << x << endl;
#define pp(x,y) cout << "pp: " << x << " " << y << endl;
#define rank __RANK
inline ll read(){
	register ll x=0,f=1;register char c=gc();
	for(;!isdigit(c);c=gc())if(c=='-')f=-1;
	for(;isdigit(c);c=gc())x=(x<<1)+(x<<3)+(c^48);
	return x*f;
}
#define rd read
void write(ll x){if(x<0)x=-x,pc('-');if(x>=10)write(x/10);putchar(x%10+'0');}
void writeln(ll x){write(x);puts("");}
const int mod = 1e9+7; 
inline int qpow(int a,int b){
	int ans = 1;
	for(;b;b>>=1,a=1ll*a*a%mod)
		if(b&1)ans=1ll*ans*a%mod;
	return ans;
}
#define MN 40000005
int S;
unsigned a[MN];
inline void add(ll &x,int y){(x+=y)>=mod?x-=mod:0;}
ll ans;
signed main(){
	S = rd();
	for(int i=1;i<=4e7;++i) a[i] = a[i/10] + 1;
	int r = 1,sum = 0;
	for(int i=1;i<1e7;++i){
		while(sum < S) sum += a[r],++r;
		if(sum == S) ans = (ans+1)%mod;
		sum -= a[i];
	}
	for(int i=1;i<=S/8;++i){
		if(S%i!=0){
			ans = (ans+1)%mod;
		} else
		if(S%i==0){
			ans = (ans + (qpow(10,S/i) - qpow(10,S/i-1) - i + 1) % mod + mod) % mod;
		}
	}
	writeln(ans);
}

Measured memory_bytes: 156672
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;

int main(){
    int n;
    cin>>n;
    vector<int>a(100005);
    for(int i=0;i<n;i++){
        int k;
        cin>>k;
        a[k]++;
    }
    int cnt=0;
    for(int i=1;i<=100001;i++){
        cnt=max(cnt,a[i-1]+a[i]+a[i+1]);
    }
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 3756
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+10;
int a[N],b[N];
pair<int ,int >p[N];
int main()
{
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);
	double c;
	cin>>c;
	printf("%lf",c/3.0*c/3.0*c/3.0);
    return 0;
}


Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

class UnionFind:
    def __init__(self, n):
        self.state = [-1] * n
        self.size_table = [1] * n
        # cntはグループ数
        # self.cnt = n

    def root(self, u):
        v = self.state[u]
        if v < 0: return u
        self.state[u] = res = self.root(v)
        return res

    def merge(self, u, v):
        ru = self.root(u)
        rv = self.root(v)
        if ru == rv: return
        du = self.state[ru]
        dv = self.state[rv]
        if du > dv: ru, rv = rv, ru
        if du == dv: self.state[ru] -= 1
        self.state[rv] = ru
        # self.cnt -= 1
        self.size_table[ru] += self.size_table[rv]
        return

    # グループの要素数
    def size(self, u):
        return self.size_table[self.root(u)]

def ng():
    for u in range(n):
        for v in range(n):
            if v == u: continue
            if to[u][v]: continue
            if uf.root(u)==uf.root(v):return True
    return False

n,m=MI()
to=[[False]*n for _ in range(n)]
for _ in range(m):
    u,v=MI1()
    to[u][v]=to[v][u]=True

uf=UnionFind(n)
uncon=[-1]*n
for u in range(n):
    pv=-1
    for v in range(n):
        if v==u:continue
        if to[u][v]:continue
        if pv==-1:pv=v
        else:uf.merge(pv,v)
    uncon[u]=pv

#print(uf.state)
#print(uf.size_table)
#print(uncon)

if ng():
    print(-1)
    exit()

fin=[False]*n
free=0
ss=[]
for u in range(n):
    if uncon[u]==-1:
        free+=1
        continue
    r0=uf.root(u)
    if fin[r0]:continue
    r1=uf.root(uncon[u])
    fin[r0]=fin[r1]=True
    ss.append(abs(uf.size_table[r0]-uf.size_table[r1]))
cur=1<<1000
for s in ss:cur=cur<<s|cur>>s
cur>>=1000
d=(cur&-cur).bit_length()-1
d=max(0,d-free)
s0=(n-d)//2
s1=n-s0
print(s0*(s0-1)//2+s1*(s1-1)//2)


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

#define PI 3.1415926535897932
#define MOD 1000000007
#define INF 1e9

#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define FOR(i, start, end) for(int i = (start); i < (end); i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;


void solve()
{
    int N; cin >> N;
    vs s(N); REP(i, N) cin >> s[i];
    int M; cin >> M;
    vs t(M); REP(i, M) cin >> t[i];

    int ans = 0;
    REP(i, N)
    {
        int money = 0;
        REP(j, N) if(s[j] == s[i]) money++;
        REP(j, M) if(t[j] == s[i]) money--;
        ans = max(ans, money);
    }
    cout << ans << endl;
}

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

    solve();

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,a=0;cin>>n;
  vector<int>d(n);
  for(int i=0;i<n;i++)cin>>d.at(i);
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++)a+=d.at(i)*d.at(j);
  }
  cout<<a<<endl;
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <cmath>
#include <ctime> 
#include <queue>
#include <stack>
#include <bitset> 
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <cstring>
#include <iostream>
#include <algorithm>

#define fi first
#define se second
#define pb push_back
#define MP std::make_pair
#define PII std::pair<int, int>
#define all(x) (x).begin(), (x).end()
#define CL(a, b) memset(a, b, sizeof a)
#define rep(i, l, r) for (int i = (l); i <= (r); ++ i)
#define per(i, r, l) for (int i = (r); i >= (l); -- i)
#define PE(x, a) for (int x = head[a]; x;x = edge[x].next)

typedef long long ll;

const int MAXN = 2e5 + 7;
std::map<std::string, int> mp;

int main() {
    int n;
    scanf("%d", &n);
    int mx = 0;
    rep(i, 1, n) {
        std::string s;
        std::cin >> s;
        mp[s]++;
        mx = std::max(mx, mp[s]);
    }
    for (auto i: mp) if (i.se == mx) std::cout << i.fi << std::endl;
    return 0;
}

Measured memory_bytes: 25216
d=int(input())
for i in range(d):
    X,Y,W,H=map(int,input().split())
    count=0
    n=int(input())
    for j in range(n):
        x,y=map(int,input().split())
        if X<=x<=X+W and Y<=y<=Y+H:count+=1
    print(count)


Measured memory_bytes: 5608
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
	int A, B, K,i;
	cin >> A >> B >> K;
	int N = min(A, B);
	int count = 0;
	vector<int> answer;
	for (i = 1; i <= N; i++) {
		if (A%i == 0 && B%i == 0) {
			answer.push_back(i);
		}
	}

	sort(answer.begin(), answer.end(),greater<int>());

	cout << answer[K - 1];

	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<P> Graph;

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

  int m,n;
  cin >> n >> m;
  
  int a[n],b[n],c[m],d[m];
  REP(i,n){
    cin >> a[i] >> b[i];
  }
  
  REP(i,m){
    cin >> c[i] >> d[i];
  }
  
  REP(i,n){
    int mini = MOD,point = 0;
    REP(j,m){
      if(abs(a[i]-c[j]) + abs(b[i]-d[j]) < mini){
        mini = abs(a[i]-c[j]) + abs(b[i]-d[j]);
        point = j+1;
      }
    }
    cout << point << endl;
  }

  return 0;
}

Measured memory_bytes: 256
import itertools

N = int(input())
L = list(map(int,input().split()))
 
l_list = list(itertools.combinations(L, 3))

res = 0
 
for tri in l_list:
  l = list(tri)
  l.sort()
  if (len(l) != len(set(l))):
    continue
  if (l[0] + l[1] > l[2]):
  	res += 1
    
print(res)

Measured memory_bytes: 20628
package main

import (
	"bufio"
	_ "container/heap"
	"fmt"
	"os"
	_ "sort"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

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

func lcm(a, b int) int {
	return a / gcd(a, b) * b
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
const MOD = int(1e+9) + 7
const INF = 1 << 60
const MAX = int(1e+6)

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	defer wtr.Flush()
	N, P := sc.nextInt(), sc.nextInt()
	S := sc.nextRuneSlice()
	if 10%P == 0 {
		ans := 0
		for i := 0; i < N; i++ {
			d := int(S[i] - '0')
			if d%P == 0 {
				ans += i + 1
			}
		}
		fmt.Fprintln(wtr, ans)
		return
	}
	var rests []int
	ten := 1
	for i := N - 1; i >= 0; i-- {
		d := int(S[i] - '0')
		rests = append(rests, d*ten%P)
		ten *= 10
		ten %= P
	}
	sum := make([]int, N+1)
	for i := 1; i < N+1; i++ {
		sum[i] = sum[i-1] + rests[i-1]
	}
	ans := 0
	count := make(map[int]int)
	for i := 0; i < N+1; i++ {
		ans += count[sum[i]%P]
		count[sum[i]%P]++
	}
	fmt.Fprintln(wtr, ans)
}


Measured memory_bytes: 9856
unittest
{
	assert( [ "4", "20 11 9 24" ].solve == "26 5 7 22" );
}



import std.conv;
import std.range;
import std.stdio;

void main()
{
	stdin.byLineCopy.solve.writeln;
}

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	input.popFront;
	auto as = input.front.split.to!( long[] );
	
	auto anss = new long[ as.length ];
	foreach( a; as[ 1 .. $ ] )
	{
		anss[ 0 ] ^= a;
	}
	foreach( i; 1L .. anss.length.signed )
	{
		anss[ i ] = anss[ i - 1 ] ^ as[ i - 1 ] ^ as[ i ];
	}
	return anss.to!( string[] ).join( " " );
}


Measured memory_bytes: 22524
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
using namespace std;
int n,a,b,kn=0,kg=0;
string s;
signed main(){
	cin>>n>>a>>b>>s;
	rep(i,n){
		if(s[i]=='a'){
			if(kn+kg<a+b){
				cout<<"Yes"<<endl;
				kn++;
			}else{
				cout<<"No"<<endl;
			}
		}elif(s[i]=='b'){
			if(kg+kn<a+b&&kg<b){
				cout<<"Yes"<<endl;
				kg++;
			}else{
				cout<<"No"<<endl;
			}
		}else{
			cout<<"No"<<endl;
		}
	}
}

Measured memory_bytes: 896
#include <cstdio>
#include <cmath>

int main(void) {
    int a,b;
    scanf("%d%d", &a, &b);
    int x = 50*(b-a-1);
    int i=0;
    while(i<=100) {
        if( (x+i)*8/100 == a && (x+i)*10/100 == b) {
            printf("%d",x+i );
             return 0;
        }  else {
            i++;
        }
    }
    printf("-1");
    return 0;
}


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

int main() {
  int s;
  cin >> s;
  vector<int> a;
  int x = s;
  int cnt = 1;
  while(true){
    a.push_back(x);
    rep(i,a.size()-1){
       if(a.at(i) == x){
        cout << cnt << endl;
        return 0;
      }
    }
    if(x%2==0)  x /=2;
    else x = 3*x+1;
    cnt ++;
  }
 }


Measured memory_bytes: 256
S = int(input())

L = S//3
mod = 10**9+7

from operator import mul
from functools import reduce
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

res = 0

for l in range(1,L+1):
    s = S - l*3
    a = cmb(s+l-1, l-1)
    res += a

print(int(res%mod))

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


int main()
{
int n,x,t;
cin>>n>>x>>t;
int time;
time=n/x;
if(n%x!=0)time++;
cout <<time*t;



}

Measured memory_bytes: 3632
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
    };
}

fn main() {
    let (N, X) = get!(u64, u64);
    let Lstr = get!(String);
    let Ls: Vec<u64> = Lstr.split_whitespace().map(|t| t.parse::<u64>().unwrap()).collect();
    let mut pos = 0;
    let mut cnt = 1;
    for L in Ls.iter() {
        pos += *L;
        if pos <= X {
            cnt += 1;
        } else {
            break;
        }
    }
    println!("{}", cnt);
}


Measured memory_bytes: 4352
function main(input){
  const N = input.split("\n")[0];
  const arrV = input.split('\n')[1].split(' ').map((n) => parseInt(n, 10));
  const arrC = input.split('\n')[2].split(' ').map((n) => parseInt(n, 10));
  var sum=0;
  for(var i=0; i<N; i++){
    if(arrV[i]-arrC[i]>=0){
      sum+=arrV[i]-arrC[i]
    }
  }
  console.log(sum);
}

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

Measured memory_bytes: 7372
import java.util.Scanner;

public class Main {

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

	    String s=gs();
	    
	    
	    //System.out.print(f);
	    if (s.length()==2) {
	    	System.out.print(s);
	    }else {
	    	StringBuffer sb=new StringBuffer(s);
	    	System.out.print(sb.reverse().toString());
	    }



	}

	public static long d(long n) {
		String a=String.valueOf(n);
		return (long)a.length();
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

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

int main()
{
   int n;
   ll sum = 0;
   cin >> n;
   for(int i = 1; i <= n; i++)
   {
       for(int j = 1; j <= n; j++)
       {
           for(int k = 1; k <= n; k++)
           {
               sum += __gcd(i, __gcd(j, k));
           }
       }
   }
   cout << sum << endl;
    return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long int;

int main(){
    int n; cin >> n;
    vector<int> a(n);
    for(auto& v:a){
        cin >> v;
    }
    // X - Y in [i, j]
    vector<vector<ll>> dp(n, vector<ll>(n, 0));
    // length = 1
    for(int i=0; i<n; i++){
        if(1 == n%2){
            dp[i][i] = a[i];
        }
        else{
            dp[i][i] = -a[i];
        }
    }
    // length > 1
    for(int l=2; l<n+1; l++){
        for(int i=0; i<n-l+1; i++){
            // First turn (Maximize)
            if(l%2 == n%2){
                dp[i][i+l-1] = max(dp[i][i+l-2] + a[i+l-1], dp[i+1][i+l-1] + a[i]);
            }
            // Second turn (Minimize)
            else{
                dp[i][i+l-1] = min(dp[i][i+l-2] - a[i+l-1], dp[i+1][i+l-1] - a[i]);
            }
        }
    }
    // for(auto& line:dp){
    //     for(auto& v:line){
    //         cout << v << " ";
    //     }
    //     cout << endl;
    // }
    cout << dp[0][n-1] << "\n";
    return 0;
}

Measured memory_bytes: 70656
n = int(input())
a_array = map(int, input().split())
MOD = 10 ** 9 + 7
a_array = [a % MOD for a in a_array]
sum = 0
square_sum = 0
for i in range(n):
    sum += a_array[i]
    sum %= MOD
    square_sum += pow(a_array[i], 2, MOD)
    square_sum %= MOD

ans = pow(sum, 2, MOD) - square_sum
ans *= 500000004
ans %= MOD
print(ans)


Measured memory_bytes: 30992
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s,t,z;
  cin>>s>>t;
  for(int i=0;i<s.size();i++){
    s=s.at(s.size()-1)+s.substr(0,s.size()-1);
    if(s==t){
      cout<<"Yes";
      return 0;
    }
  }
  cout<<"No";
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int sx, sy, tx, ty;
  scanf("%d%d%d%d", &sx, &sy, &tx, &ty);

  // 差を求める
  int dx,dy;
  dx = tx - sx;
  dy = ty - sy;

  // 経路１
  for(int i = 0; i < dy; i++){
    printf("U");
  }
  for(int i = 0; i < dx; i++){
    printf("R");
  }

  // 経路２
  for(int i = 0; i < dy; i++){
    printf("D");
  }
  for(int i = 0; i < dx; i++){
    printf("L");
  }

  // // 経路３
  printf("L");
  for(int i = 0; i < dy+1; i++){
    printf("U");
  }
  for(int i = 0; i < dx+1; i++){
    printf("R");
  }
  printf("D");

  // // 経路４
  printf("R");
  for(int i = 0; i < dy+1; i++){
    printf("D");
  }
  for(int i = 0; i < dx+1; i++){
    printf("L");
  }
  printf("U");

  return 0;
}

Measured memory_bytes: 128
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main=do
    n<-readLn
    (a,b)<-maximum.map (\[a,b]->(a,b)) <$> replicateM n (map read.words<$>getLine)::IO(Int,Int)
    print $ a+b


Measured memory_bytes: 127356
/*
    Author: Aryan Yadav
*/
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mod 1000000007
#define f(i, a, b) for (long long i = a; i < b; i++)
#define rep(i, a, b) for (long long i = a; i <= b; i++)
#define fm(i, a, b) for (long long i = a; i > b; i--)
#define repm(i, a, b) for (long long i = a; i >= b; i--)
#define vi vector<int>
#define vl vector<long long>
#define vs vector<string>
#define pqmaxi priority_queue<int>
#define pqmaxl priority_queue<ll>
#define pqmini priority_queue<int, vi, greater<int>>
#define pqminl priority_queue<ll, vl, greater<ll>>
#define all(x) x.begin(), x.end()
#define test     \
    ll test;     \
    cin >> test; \
    while (test--)
#define pb(i) push_back(i)
#define mp(i, j) make_pair(i, j)
#define fast                     \
    ios::sync_with_stdio(false); \
    cin.tie(NULL)

int main()
{
    fast;
    ll n;
    cin >> n;
    vl v(n);
    f(i, 0, n)
    {
        cin >> v[i];
    }
    sort(all(v));
    reverse(all(v));
    ll alc = 0;
    ll bob = 0;
    f(i, 0, n)
    {
        if (i % 2 == 0)
        {
            alc += v[i];
        }
        else
        {
            bob += v[i];
        }
    }
    cout << alc - bob;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
int main(void){
  int N;
  cin >> N;
  vector<int> H(N);
  for(int i = 0; i < N; i++) cin >> H[i];
  int H_MAX = H[0];
  int Count = 0;
  for(int i = 0; i < N; i++){
      if(H_MAX <= H[i]){
          Count++;
          H_MAX = H[i];
      }
  }
  cout << Count << endl;
 }


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

void GCD(int a, int b){
	int r; r=a%b;
	if(r!=0)
		GCD(b,r);
	else
		cout << b << endl;
}
int main(){
	int a,b; cin >> a >> b;
	GCD(a,b);
	return 0;
}

Measured memory_bytes: 3112