akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int i;
  int a,b,c;
  cin >> i;
  a = i / 100;
  b = (i % 100) / 10;
  c = i % 10;
  if(a == 7 || b == 7 || c == 7) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
    ll A,B,K;
    cin >> A >> B >> K;

    if (K <= A)cout << A-K << " " << B << endl;
    else if (A+B >= K)cout << 0 << " " << A+B-K << endl;
    else cout << 0 << " " << 0 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    int a,b;
    cin>>a>>b;
    rep(i,10000) if(int(i*0.08)==a&&int(i*0.1)==b){
        cout<<i;
        return 0;
    }
    cout<<-1;
}

Measured memory_bytes: 256
N = int(input())
h = list(map(int,input().split()))

dp = [[] for i in range(N)]
dp[0] = 0
dp[1] = abs(h[0]-h[1])

for i in range(1,N-1):
  dp[i+1] = min( dp[i] + abs(h[i+1] - h[i]), dp[i-1] + abs(h[i+1] - h[i-1]))
  
print(dp[-1])

Measured memory_bytes: 14592
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
 
using namespace std;
 
#define ll long long
#define pi pair<int,int>
#define pll pair<ll,ll>
#define pii pair<int,pi>
#define X first
#define Y second
#define pb push_back
#define ab(x) ((x)<0?(-(x)):(x))
#define xx(x) ((x)*(x))
#define mp make_pair
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
#define vpi vector<pi>
#define vpll vector<pll>
#define ALL(x) (x).begin(),(x).end()
#define Max (1<<30)
#define LLMax (1ll<<60)
template<class T>string ToString(T t){stringstream s;s<<t;return s.str();}
template<class T>void ToOther(T&t,string a){stringstream s(a);s>>t;}


int n,L;
int ck[11000000];
int TT[11000000];

int NEXT(int x,int L){
	string r=ToString(x);
	while(r.size()<L)r+='0';
	string r2=r;
	sort(ALL(r),greater<char>() );
	sort(ALL(r2));
	int A,B;
	ToOther(A,r);
	ToOther(B,r2);
	return A-B;
}

int main(){
	int CC=0;
	while(cin>>n>>L){
		CC++;
		if(n==0 && L==0)break;
		
		for(int i=0;;i++){
			if(TT[n]==CC){
				cout<<ck[n]<<" "<<n<<" "<<i-ck[n]<<endl;
				goto E;
			}
			TT[n]=CC;
			ck[n]=i;
			n=NEXT(n,L);
		}
		E:;
	}
}

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

    int main(){
        ll n , l;
        
        cin >> n >> l ;
        ll ans = 0;
        ans = n * (n - 1) / 2;
        ans += n * l;
        if(l <= 0 && l + n - 1 >= 0){
            cout << ans << endl;
        }else if(l <= 0){
            cout << ans - (l + n - 1) << endl;
        }else{
            cout << ans - l << endl;
        }
        
        
        return 0;
        
    }

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

using namespace std;
#define ll long long


int main() {
int n;
cin>>n;
vector<long long> v;
for(int i=0;i<n;i++)
{
    ll a;
    cin>>a;
    v.push_back(a);
    
}


sort(v.begin(),v.end());
if(v[(n/2)-1]==v[n/2])
cout<<0;
else
cout<<v[n/2]-v[(n/2)-1];



return 0;
}

Measured memory_bytes: 1400
a = list(map(int , input().split()))
a.sort()
ans = 0
ans += ((a[-1]-a[0]) // 2)
ans += ((a[-1]-a[1]) // 2)
a[0] += 2 * ((a[-1]-a[0]) // 2)
a[1] += 2 * ((a[-1]-a[1]) // 2)
a.sort()
if a[0] < a[-1] and a[1] == a[-1]:
    print(ans + 2)
    exit()
if a[0] < a[-1] and a[1] < a[-1]:
    print(ans + 1)
    exit()
print(ans)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;

int main(){
  int n,y;cin >> n >>y;
  for(int man=0;man<=n;man++){
    int a = n-man;
    for(int gosen=0;gosen<=n;gosen++){
      int b=a-gosen;
      if(b<0) continue;
      if(10000*man+5000*gosen+b*1000==y){
        cout << man << " " << gosen << " " << b << endl;
        return 0;
      }
    }
  }
  cout << -1 << " " << -1 << " " << -1 << endl;
}


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

int main()
{
	int n, r[200000];
	cin >> n;
	for (int i = 0; i < n; i++) cin >> r[i];

	int maxValue = r[1] - r[0];
	int minValue = r[0];

	for (int i = 0; i < n - 1; i++) {
		minValue = min(minValue, r[i]);
		maxValue = max(maxValue, r[i + 1] - minValue);
	}

	cout << maxValue << "\n";
}


Measured memory_bytes: 3872
#include <bits/stdc++.h>
typedef long long ll; 
const ll mod = 1e9+7;
#define fo(i, n) for (int i = 0; i < n; i++)
#define sc(n) scanf("%d", &n) 
using namespace std;

int n, m;

void solve() {
    sc(n); sc(m);
    printf("%d", (n)*(n-1)/2 + (m)*(m-1)/2);
}

int main() {
    int t = 1;
    //scanf("%d", &t);
    while (t--) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        nxm: (u64, usize, usize),
    };
    let n = nxm.0;
    let x = nxm.1;
    let m = nxm.2;
    let mut v: Vec<usize> = vec![0;m];
    let mut p: Vec<u64> = vec![0;m];
    let mut a = x;
    v[a] = 1;
    p[a] = a as u64;
    let mut sum_all = a as u64;
    let mut i = 1;
    let mut s;
    let mut t;
    let mut sum_start: u64;
    let mut sum_loop: u64;
    loop {
        if i as u64 >= n {
            println!("{}", sum_all);
            return;
        }
        i += 1;
        a = (a * a) % m;
        sum_all += a as u64;
        if v[a] == 0 {
            v[a] = i;
            p[a] = sum_all;
        } else {
            s = v[a];
            t = i;
            sum_start = p[a];
            sum_loop = sum_all - sum_start;
            break;
        }
    }
    let cnt_last = (n - s as u64) % (t as u64 - s as u64);
    let cnt_loop = (n - s as u64) / (t as u64 - s as u64);
    let sum_loops = sum_loop * cnt_loop;
    let mut sum_last = 0;
    for _ in 0..cnt_last {
        a = (a * a) % m;
        sum_last += a as u64;
    }
    println!("{}", sum_start + sum_loops + sum_last);
}


Measured memory_bytes: 3640
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    const W = parseInt(arg[1]);
    
    let answer = [];
    
    for(let i in S) {
        if(i % W === 0) {
            answer.push(S[i]);
        }
    }
    
    console.log(answer.join(""));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

int main(){
    int a, b, k;
    cin >> a >> b >> k;
    int n = min(a, b);
    vector<int> ans;
    for(int i = 1; i <= n; i++){
        if(a % i == 0 && b % i == 0){
            ans.push_back(i);
        }
    }
    sort(ans.begin(), ans.end(), greater<int>());
    cout << ans[k - 1] << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;

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

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

int main() {
  int N;
  cin >> N;
  cout << N * (N % 2 + 1) << endl;
}

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

int main(){
  string A,B;
  cin>>A>>B;
  if(A.size()!=B.size()){
    if(A.size()>B.size())
      cout<<"GREATER"<<endl;
    else
      cout<<"LESS"<<endl;
    return 0;
  }
  for(int i=0;i<A.size();i++)
    if(A[i]!=B[i]){
      if(A[i]>B[i])
        cout<<"GREATER"<<endl;
      else
        cout<<"LESS"<<endl;
      return 0;
    }
  cout<<"EQUAL"<<endl;
}

Measured memory_bytes: 256
while True:
    m, f, r = map(int, input().split())
    total = m + f
    if m == f == r == -1:
        break
    elif m == -1 or f == -1:
        print("F")
    elif 80 <= total:
        print("A")
    elif 65 <= total:
        print("B")
    elif 50 <= total:
        print("C")
    elif 30 <= total:
        if 50 <= r:
            print("C")
            continue
        print("D")
    else:
        print("F")
        

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

using namespace std;
int n, a[105], s1, s2;
int main()
{
    cin >> n;
    for(int i =1;  i <= n; ++i )
        cin >> a[i];
    sort(a + 1, a + n + 1);
    for(int i = n; i >= 1; --i)
        if(i & 1)s1 += a[i];
        else s2 += a[i];
    cout << max(s1, s2) - min(s1, s2);
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char a = sc.next().toUpperCase().charAt(0);
        char b = sc.next().toUpperCase().charAt(0);
        char c = sc.next().toUpperCase().charAt(0);
        System.out.println(a+""+b+""+c);
    }
}

Measured memory_bytes: 23508
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-12;

//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;

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

	while (cin >> W >> H, H) {
		vector<string>field(H);
		for (auto &i : field)cin >> i;
		vector<vector<string>>dp(H, vector<string>(W, ""));
		string ans;
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				if (field[i][j] >= '0'&&field[i][j] <= '9') {
					string add;
					add.push_back(field[i][j]);
					if (field[i][j]!='0'&&dp[i][j].empty())dp[i][j].push_back(field[i][j]);
					if (i - 1 >= 0) {
						if ((dp[i - 1][j] + add).size() > dp[i][j].size() || ((dp[i - 1][j] + add) > dp[i][j] && (dp[i - 1][j] + add).size() == dp[i][j].size())) {
							dp[i][j] = (dp[i - 1][j] + add);
						}
					}
					if (j - 1 >= 0) {
						if ((dp[i][j - 1] + add).size() > dp[i][j].size() || ((dp[i][j - 1] + add) > dp[i][j]) && (dp[i][j - 1] + add).size() == dp[i][j].size()) {
							dp[i][j] = (dp[i][j - 1] + add);
						}
					}
					if (dp[i][j] == "0")dp[i][j].clear();
				}
			}
		}
		for (auto i : dp) {
			for (auto j : i) {
		//		cout << j << " ";
				if (ans.size() < j.size())ans = j;
				else if (ans.size() == j.size() && ans < j)ans = j;
			}
		//	cout << endl;
		}
		cout << ans << endl;
	}
}


Measured memory_bytes: 3296
Q, H, S, D = map(int, input().split())
N = int(input())

new_S = min(2 * min(2 * Q, H), S)
if 2 * new_S >= D:
    q, r = divmod(N, 2)
    print(q * D + r * new_S)
else:
    print(N * new_S)


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

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N, K;
    cin >> N >> K;
    vector<int> p(N);
    for (int i = 0; i < N; i++) {
        cin >> p[i];
    }
    vector<double> accumulate(N + 1);
    accumulate[0] = 0;
    for (int i = 0; i < N; i++) {
        accumulate[i + 1] = ( p[i] + 1.0 ) / 2.0 + accumulate[i];
    }
    double max_e = 0;
    for (int i = 0; i < N - K + 1; i++) {
        double tmp = accumulate[i + K] - accumulate[i];
        if ( max_e < tmp ) {
            max_e = tmp;
        }
    }
    cout << setprecision(15) << fixed <<  max_e << endl;
    return 0;
}

Measured memory_bytes: 3456
h, w = map(int, input().split())
s = [input() for _ in range(h)]

l = [[0] * w for _ in range(h)]
r = [[0] * w for _ in range(h)]
u = [[0] * w for _ in range(h)]
d = [[0] * w for _ in range(h)]

for i in range(h):
  for j in range(w):
    if s[i][j] == '.':
      l[i][j] = l[i][j-1] + 1
      u[i][j] = u[i-1][j] + 1
    if s[i][-j-1] == '.':
      r[i][-j-1] = r[i][-j] + 1
    if s[-i-1][j] == '.':
      d[-i-1][j] = d[-i][j] + 1
    
torch = 0
for i in range(h):
  for j in range(w):
    torch = max(torch, l[i][j]+r[i][j]+u[i][j]+d[i][j]-3)

print(torch)

Measured memory_bytes: 179204
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

int n;
int a[21][21];
int dp[22][1<<21];

const int mod=1000000007;

signed main(void){
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);  

    cin>>n;
    rep(i,n)rep(j,n)cin>>a[i][j];

    dp[0][0]=1;
    rep(i,n)rep(bit,1<<n)if(i == __builtin_popcount(bit)){
        rep(j,n)if(!(bit&(1<<j)))if(a[i][j]){
            (dp[i+1][bit|(1<<j)]+=dp[i][bit])%=mod;
        }
    }

    cout<<dp[n][(1<<n)-1]<<endl;
    return 0;

}

Measured memory_bytes: 309504
#!/usr/bin/env python
# -*- coding: utf-8 -*-

[a, b] = map(int, input().split())
[a, b] = map(lambda s: 14 if s==1 else s, [a, b])
if a==b:
    print("Draw")
elif a > b:
    print("Alice")
else:
    print("Bob")


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

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

long long lcm(long long a, long long b) {
    return a*b / gcd(a,b);
}

int main() {
    long long A, B, C, D, c, d, cd;
    cin >> A >> B >> C >> D;
    c = (B/C) - (A-1)/C; // Cで割り切れるA以上B以下の数の個数
    d = (B/D) - (A-1)/D; // Dで割り切れるA以上B以下の数の個数
    cd = (B/lcm(C,D)) - (A-1)/lcm(C,D);
    cout << (B-A+1) - c - d + cd << endl;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
//#include <atcoder/all>
#define ll long long int
#define MOD 1000000007
#define P pair<ll,ll>
#define INF 1000000000000000000

//using namespace atcoder;
using namespace std;

int main(void){
  ll n, k;
  cin >> n >> k;
  
  string s;
  cin >> s;
  
  vector<vector<ll>> data(2, vector<ll>(0));
  int cur = 1, num = 0;
  for (ll i = 0; i < s.size(); i++){
    if (s[i] - '0' == cur){
      num++;
    }
    else {
      data[cur].emplace_back(num);
      num = 1;
      cur = 1 - cur;
    }
  }
  if (cur == 1)
    data[cur].emplace_back(num);
  else {
    data[0].emplace_back(num);
    data[1].emplace_back(0);
  }
  
  ll ans = 0, sum = 0;
  if (data[1].size() <= k){
    ans = n;
  }
  else {
    sum += data[1][0];
    for (ll i = 0; i < k; i++){
      sum += data[1][i+1];
      sum += data[0][i];
    }


    ans = sum;
    for (ll i = k; i < data[0].size(); i++){
      sum -= data[1][i-k];
      sum -= data[0][i-k];
      sum += data[1][i+1];
      sum += data[0][i];
      ans = max(ans, sum);
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 4532
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
const int INF = 1000000009;
const ll LINF = 1e18;

int main() {
  int a, b; cin >> a >> b;
  cout << a * b << endl;
}


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

public class Main {

	final static long MOD = 1000000007L;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static ArrayList<int[]> list = new ArrayList<>();
	public static long[] ans = new long[]{-1,-1,-1};
	public static void main(String[] args) throws Exception {


		String s = nextString();
		String[] ans = new String[s.length()];
		int idx=0;
		for(int i=0;i<s.length();i++){
			if(s.charAt(i)=='0'){
				ans[idx]="0";
				idx++;
			}else if(s.charAt(i)=='1'){
				ans[idx]="1";
				idx++;
			}else{
				idx=Math.max(0, idx-1);
			}
		}
		for(int i=0;i<idx;i++){
			System.out.print(ans[i]);
		}
		System.out.println("");
	}

	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


Measured memory_bytes: 21332
a = int(input())
als = [0]*(10**6+2)
for i in range(0,10**6+2):
    als[a] = 1
    if a%2 == 0:
        a = a//2
    else:
        a = 3*a+1
    if als[a] == 1:
        print(i+2)
        exit()


Measured memory_bytes: 10868
import numpy as np

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

K = 50
grid = np.ones((100, 100), dtype='int')

# 白1黒0
grid[:K, :] = 0

A -= 1
col = 0
row = 0
while A:
    if A >= K:
        grid[col, ::2] = 1
        A -= K
        col += 2
        continue

    grid[col, row] = 1
    row += 2
    A -= 1

B -= 1
col = K + 1
row = 0
while B:
    if B >= K:
        grid[col, ::2] = 0
        B -= K
        col += 2
        continue

    grid[col, row] = 0
    row += 2
    B -= 1

grid = np.where(grid, '.', '#')
print(100, 100)
print('\n'.join(map(''.join, grid.tolist())))

Measured memory_bytes: 12628
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            Solve();

            Console.ReadKey();
        }

        static void Solve()
        {
            var ans = Math.Pow(IO.GetInt(), 3);
            
            Console.WriteLine(ans);
        }
    }


    static class IO
    {
        static public string GetString() { return Console.ReadLine(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public List<string> GetStringList() { return Console.ReadLine().Split(' ').ToList(); }
        static public List<int> GetIntList() { return Console.ReadLine().Split(' ').Select(int.Parse).ToList(); }
        static public List<long> GetLongList() { return Console.ReadLine().Split(' ').Select(long.Parse).ToList(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteStrings<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
    }
}

Measured memory_bytes: 11220
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define REP(i, b, n) for (Int i = b; i < Int(n); i++)
#define rep(i, n) REP(i, 0, n)
using namespace std;
using Int = long long;
Int inf = 1000000000000000001LL;
using vi = vector<Int>;
using vvi = vector<vi>;
using mapis = unordered_map<Int,string>;
using mapii = unordered_map<Int,Int>;
using pii = pair<Int,Int>;

Int GCD(Int a, Int b){
    if(b==0) return a;
    if(a < b) return GCD(b, a);
    unsigned r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}
Int printX(Int r, Int D, Int X, int count){
    if(count == 10){
        return 0;
    }
    Int nextX = r*X - D;
    cout<< nextX <<endl;
    printX(r,D,nextX,count+1);

}

int myPow(int x, int p) {
    if (p == 0) return 1;
    if (p == 1) return x;
    return x * myPow(x, p-1);
}

int main() {
    Int N;
    cin >> N;

    string ans = ":(";

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

    REP(i,1,N+1){
        int tmpans =i*1.08;
        if(tmpans == N){
            cout << i << endl;
            return 0;
        }

    }


    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;

public class Main {
	public static void main(String[] args) {
		FastScanner scan = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		PriorityQueue<BigDecimal> v = new PriorityQueue<BigDecimal>();

		for (int i = 0; i < n; i++) {
			v.add(new BigDecimal(scan.nextInt()));
		}

		BigDecimal per = new BigDecimal(2);
		while (v.size() > 1) {
			v.add(v.poll().add(v.poll()).divide(per, 5,
					BigDecimal.ROUND_HALF_UP));
		}

		out.println(v.poll());
		out.flush();
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	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: 21460
#include <iostream>
#include <stack>
#include <algorithm>
#include <math.h>
#include <string.h>

using namespace std;

int H, W;
char a[200][200];
int use_h[200];
int use_w[200];

int main(int argc, char** argv) {
    cin >> H >> W;
    for (int i=0; i<H; i++) cin >> a[i];

    for (int i=0; i<H; i++) for (int j=0; j<W; j++) if (a[i][j] == '#') use_h[i] = 1;
    for (int i=0; i<H; i++) for (int j=0; j<W; j++) if (a[i][j] == '#') use_w[j] = 1;
    for (int i=0; i<H; i++) {
        for (int j=0; j<W; j++) {
            if (use_h[i] && use_w[j]) cout << a[i][j];
        }
        if (use_h[i]) cout << endl;
    }
}

Measured memory_bytes: 256
import random

N = int(input())
A_in = list(map(int,input().split()))

def sorrow_value(A,b):
    value = 0
    for i in range(N):
        value += abs(A[i]-b)
    return value

def quick_sort(array):
    low_array = []
    high_array = []
    len_array = len(array)
    if len_array <= 1:
        return array
    pivot = random.choice(array)
    pivot_count = 0
    for i in range(len_array):
        if pivot > array[i]:
            low_array.append(array[i])
        elif pivot < array[i]:
            high_array.append(array[i])
        else:
            pivot_count += 1
    low_array = quick_sort(low_array)
    high_array = quick_sort(high_array)
    return low_array + [pivot]*pivot_count + high_array

for i in range(N):
    A_in[i] -= i+1
A = quick_sort(A_in)

if len(A)%2 == 0:
    if A[int(N/2)]-A[int(N/2-1)] >= 1:
        print(sorrow_value(A,A[int(N/2)]))
    else:
        print(min(sorrow_value(A,A[int(N/2)]),sorrow_value(A,A[int(N/2-1)])))
else:
    print(sorrow_value(A,A[int(N/2)]))


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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n,W; cin>>n>>W;
	vector<int>w(n),v(n);
	for(int i=0;i<n;++i){
		cin>>w.at(i)>>v.at(i);
	}
	vector<vector<int64_t>>dp(2,vector<int64_t>(W+1));
	dp.front().front()=0;
	for(int i=0;i<n;++i){
		for(int j=0;j<=W;++j){
			if(j<w.at(i))dp.at((i+1)&1).at(j)=dp.at(i&1).at(j);
			else dp.at((i+1)&1).at(j)=max(dp.at(i&1).at(j),dp.at(i&1).at(j-w.at(i))+v.at(i));
		}
	}
	cout<<dp.at(n&1).back()<<"\n"s;
}


Measured memory_bytes: 5576
/**
*   @Author : MeGA
*   @InitTime :01/24/20 12:50:28
*   @Idea : 
*
*
*
*
*
*
*
**/
#include <bits/stdc++.h>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
  // freopen("in","r",stdin);
  // freopen("out","w",stdout);
#endif
     long long n;
     scanf("%lld",&n);
     cout<<((n)*(n+1)/2)-n<<endl;



}

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

using namespace std;
typedef long long int ll;

#define endl '\n'

ll n,k;

vector <ll> vec[100005];

ll mod = 1000000007;
ll solve(ll u,ll p){

    ll val = 1;
    ll c = k-1;
    if(u!=1){
        c--;
    }

    for(ll i=0;i<vec[u].size();i++){
        ll v = vec[u][i];
        if(v!=p){
            val = (mod+val*c)%mod;
            c--;
        }
    }

    for(ll i=0;i<vec[u].size();++i){
        ll v =vec[u][i];
        if(v!=p){
            val = (mod+val*solve(v,u))%mod;
        }
    }

    return val;


}

int main()
{
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>k;

    for(ll i=0;i<n-1;i++){
        ll a,b;
        cin>>a>>b;
        vec[a].push_back(b);
        vec[b].push_back(a);
    }

    ll ans = (mod+k*solve(1,-1))%mod;

    cout<<(mod+ans)%mod<<endl;



}









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

int main() {
  int A,B,count=0;
  cin >> A >> B;
  
    for(int i=1;i<=9;i++)
		for(int j=0;j<=9;j++)
          for(int k=0;k<=9;k++)
            if(i*10000+j*1000+k*100+j*10+i<=B&&i*10000+j*1000+k*100+j*10+i>=A){
              //cout<<i*10000+j*1000+k*100+j*10+i<<endl;
              count++;
            }
  
  cout<<count<<endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, long long> pdl;

const long double pi = 3.141592653589793;

#define debug(x) cout << #x << " = " << (x) << endl;
#define rep(i, n) for(int i = 0;i < n;i++)
#define pb push_back
#define mp make_pair
#define mod 1000000007

ll power(ll a, ll b) {
	if (b == 0) return 1;
	ll pp = power(a, b/2);
	pp = (pp*pp) % mod;
	if(b%2 == 0) return pp;
	return (pp*a)%mod;
}

ll solve(ll x, ll y, ll z) {
	ll maxm = max(x, max(y, z));
	ll minm = min(x, min(y, z));
	return maxm-minm;
}

ll ans = 1LL<<40;
void solver(ll h, ll w) {
	ll mh, mw;
	for(ll i = 1;i < h;i++) {
		mh = h-i;mw = w;
		if(mh > 1) {
			ll sv = solve(mw*floor(mh/2.0), mw*ceil(mh/2.0), mw*i);
			ans = min(ans, sv);
		}
		ll sv = solve(mh*floor(mw/2.0), mh*ceil(mw/2.0), mw*i);
		ans = min(ans, sv);
	}
}

int main() {
    //freopen("input.in","r",stdin);
  	//freopen("output.out","w",stdout);
	//debug(ans);
	ll h, w, mh, mw;
	cin>>h>>w;
	solver(h, w);
	solver(w, h);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int w = sc.nextInt();
        String[] c = new String[h];
        for (int i = 0; i < h; i++) {
            c[i] = sc.next();
        }
        for (int j = 0; j < h; j++) {
            for (int i = 0; i < 2; i++) {
                System.out.println(c[j]);
            }
        }
    }
}


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

int main(){
    int d, t, s;
    cin >> d >> t >> s;

    if(d<=t*s) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3628
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back

using namespace std;
const long long MOD = (long long)1e9 + 7;

string s;
int cnt_1[100009], sum, len;
long long dat[100009], dat_2[100009];

int main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> s;
	len = s.length();
	if (s[0] == '1') cnt_1[0] = 1;
	for (int i = 1; i < len; i++) {
		cnt_1[i] = cnt_1[i - 1];
		if (s[i] == '1') cnt_1[i]++;
	}
	sum = cnt_1[len - 1];
	dat[0] = 1;
	dat[1] = 3;
	dat_2[0] = 1;
	dat_2[1] = 2;
	for (int i = 2; i <= len; i++) {
		dat[i] = dat[i - 1] * 3;
		dat[i] = dat[i] % MOD;
		dat_2[i] = dat_2[i - 1] * 2;
		dat_2[i] = dat_2[i] % MOD;
	}
	long long ans = 0;
	for (int i = 0; i < len; i++) {
		if (s[i] == '0') continue;
		int ones = sum - cnt_1[i];
		int zeros = len - 1 - i - ones;
		if (zeros == 0) continue;
		long long tmp = (dat[zeros] - 1 + MOD) % MOD;
		tmp = dat[ones] * tmp;
		tmp = tmp % MOD;
		tmp = tmp * dat_2[cnt_1[i] - 1];
		tmp = tmp % MOD;
		ans = ans + tmp;
		ans = ans % MOD;
	}
	ans = ans + dat[sum];
	ans = ans % MOD;
	cout << ans << "\n";
	//system("pause");
	return 0;
}

Measured memory_bytes: 2384
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>

#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;

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

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const int INF = 0x3fffffff;


int main(){
	int N, ans=0;
	string s,t;

	cin >> N >> s >> t;
	ans = 2 * N;
	rep(i,N){
		bool f = true;
		rep(j,t.size()){
			if( i+j < s.size() && s[i+j] != t[j] ) f = false;
		}
		if( f ){
			ans = i + N;
			break;
		}
	}

	cout << ans << endl;

	return 0;
}


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

int main() {
	string s;
	cin >> s;

	string ans = "WA";
	int c = 0;
	if (s.at(0) == 'A') {
		for (int i = 2; i < s.length()-1; i++) {
			if (s.at(i) == 'C') {
				c++;
			}
		}
		if (c == 1) {
			for (int i = 1; i < s.length(); i++) {
				if('a' <= s.at(i) && s.at(i) <= 'z') {
					ans = "AC";
				} else if (s.at(i) == 'C' && 2 <= i && i < s.length()-1) {
					ans = "AC";
				} else {
					ans = "WA";
					break;
				}
			}
		}
	}
	cout << ans << 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;
typedef long long ll;
typedef pair<ll, ll> P;

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

int main() {
  ll n;
  string s;
  cin >> n >> s;
  ll ans = 0;
  // 暗証番号は必ず3桁
  // つまり 暗証番号 000 - 999 までが実現可能か全探索する
  rep(i, 1000) {
    int c[3] = {i / 100, (i/10) % 10, i % 10};
    int f = 0;
    // n < 30000
    rep(j, n) {
      if (s[j] == ('0' + c[f])) f++;
      if (f == 3) break;
    }
    if (f == 3) ans++;
  }
  // 上記のfor文は 高々 30000*1000 = 3 * 10^7
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
a,b=map(int,raw_input().split())

if a == 1 or b == 1:
    if a < b:
        print "Alice"
    elif a == b:
        print "Draw"
    elif a > b:
        print "Bob"
else:
    if a > b:
        print "Alice"
    elif a == b:
        print "Draw"
    elif a < b:
        print "Bob"

Measured memory_bytes: 2568
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#include<bits/stdc++.h>
using namespace std;

#if defined(DAIJOBU)
#include "/home/ichigo/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}

void solve(int n){
	int x = n;
	vector<int> facs;
	while(n % 2 == 0){
		facs.push_back(2);
		n /= 2;
	}
	for(int i = 3; i * i <= n; i += 2){
		if(n % i == 0){
			while(n % i == 0){
				facs.push_back(i);
				n /= i;
			}
		}
	}
	if(n > 1)facs.push_back(n);
	sort(facs.begin(), facs.end());
	cout << x << ':';
	for(auto i:facs)cout << ' ' << i;
	cout << '\n';
}

int main(){
	FIO
	
	int n;
	cin >> n;
	solve(n);
	return 0;
}



Measured memory_bytes: 3208
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
ab = sorted(ab, key=lambda x:x[1])
deleted = ab[0][1]-1
ans = 1
for a, b in ab:
    if a <= deleted < b:
        pass
    else:
        deleted = b - 1
        ans += 1

    
print(ans)

Measured memory_bytes: 65368
using System;

class Program
{
    static void Main(string[] args)
    {
        int a, b, d, r;
        double f;
        string[] num = Console.ReadLine().Split(' ');
        a = int.Parse(num[0]);
        b = int.Parse(num[1]);

        d = a / b;
        r = a % b;
        f = (double)a / b;

        Console.Write(d + " " + r + " ");
        Console.WriteLine("{0:0.000000}", f); 
    }
}


Measured memory_bytes: 9292
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int x = sc.nextInt();
		int t = sc.nextInt();
		
        int m = n%x==0 ? n/x : n/x+1;
      // 出力
		System.out.println("" + (m*t));
	}
}

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

int main( void )
{
    char s[ 5 ];
    cin >> s;
    int ans = 0;
    for ( int i = 0; s[ i ] != '\0'; i++ )
    {
        if ( s[ i ] == '+' )
        {
            ans++;
        }
        else
        {
            ans--;
        }
    }
    cout << ans << endl;
    return 0;
}


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

A = []
for i in range(n):
    A.append(int(input()))
A.sort()
# print(A)

ans = 0
end = [A[0], A[-1]]
ans += abs(A[-1] - A[0])
A = A[1:-1]
s = 0
L = -1
for _ in range(n - 2):
    # print(ans, A, end)
    sl = [A[s], A[L]]
    # print(sl)

    tmp_l = []
    tmp_l.append(abs(end[0] - sl[0]))
    tmp_l.append(abs(end[1] - sl[0]))
    tmp_l.append(abs(end[0] - sl[1]))
    tmp_l.append(abs(end[1] - sl[1]))

    tmp = max(tmp_l)
    index = tmp_l.index(tmp)
    ans += tmp

    # print(index, tmp_l[index])
    if index % 2 == 0:
        end[0] = sl[index == 2]

    else:
        end[1] = sl[index == 3]

    if index < 2:
        s += 1
    else:
        L -= 1

print(ans)

Measured memory_bytes: 7900
#include "bits/stdc++.h"

using namespace std;
using ll = long long;
using pii = pair <int, int>;

#define endl '\n'
#define FIO() ios_base::sync_with_stdio(0);cin.tie(NULL);

const ll MOD = 998244353;

inline void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) {normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

const int mx = 2e5 + 9;

ll dp[mx];
ll suff[mx];

ll sum(int l, int r) {
    return modSub(suff[l], suff[r + 1]);
}

int main() {
    FIO();

    int n, k; cin >> n >> k;
    vector <pii> pr;

    for (int i = 0; i < k; i++) {
        int l, r; cin >> l >> r;
        pr.emplace_back(l, r);
    }

    sort(pr.begin(), pr.end());

    dp[n] = suff[n] = 1;
    for (int i = n - 1; i >= 1; i--) {
        for (auto pp : pr) {
            int l = pp.first, r = pp.second;
            if (i + l > n) break;
            if (i + r > n) {
                r = n - i;
                dp[i] = modAdd(dp[i], sum(i + l, i + r));
                break;
            } else {
                dp[i] = modAdd(dp[i], sum(i + l, i + r));
            }
        }

        suff[i] = modAdd(dp[i], suff[i + 1]);
    }

    cout << dp[1] << endl;
}

Measured memory_bytes: 6772
w,h,n = map(int, input().split())
x_min, x_max = 0, w
y_min, y_max = 0, h
for _ in range(n):
    x,y,a = map(int, input().split())
    if a == 1:
        x_min = max(x_min, x)
    elif a == 2:
        x_max = min(x_max, x)
    elif a == 3:
        y_min = max(y_min, y)
    elif a == 4:
        y_max = min(y_max, y)
dx = x_max - x_min
dy = y_max - y_min
white_space = max(dx,0) * max(dy,0)
print(white_space)

Measured memory_bytes: 3064
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int ans[17];
int cnt;
int main()
{
    long long int x;
    scanf("%lld",&x);

    while(x!=0)
    {
        ans[cnt]=x%26;
        x=x/26;
        cnt++;
    }
    for(int i=0;i<cnt-1;i++)if(ans[i]<=0)
    {
        ans[i]=ans[i]+26;
        ans[i+1]--;
    }
    if(ans[cnt-1]==0)cnt--;
    for(int i=cnt-1;i>=0;i--)printf("%c",'a'+ans[i]-1);
    return 0;
}


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

#define rp(i, n) for (int i = 0; i < n; i++)
#define ll  long long
int main() {
    string S;
    ll K;
    cin >> S >> K;
    for (int i = 0; i < K; i++) {
        if (S.at(i) == '1') {
            continue;
        }
        else {
            cout << S.at(i) << endl;
            return 0;
        }
    }
    cout << '1' <<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

int main(){
	int n,c,k;
	int t[100010];
	scanf("%d%d%d",&n,&c,&k);
	rep(i,n)scanf("%d",&t[i]);
	
	vector<int> vec;
	rep(i,n)vec.pb(t[i]);
	sor(vec);
	
	int ret = 0;
	int s = 0;
	rep(i,n){
		if(s+c <= i || vec[s]+k < vec[i]){
			ret ++;
			s += c;
			s = min ( s , i );
		}
	}
	cout << ret+1 << endl;
}



Measured memory_bytes: 1276
module.exports=function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var i=r(1);r(2)(i.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";var i=r(3),n=r(5);t.exports=function(t){var e=new i(t);n(e)}},function(t,e,r){"use strict";var i=r(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new i(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,r){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,r){"use strict";var i=r(6);t.exports=function(t){for(var e=t.in(),r=new Array(e),n=0;n<e;n++)r[n]=t.in();for(var s=new i(r),o=new i(r,function(t,e){return Math.min(t,e)},99999999999),u=t.in(),h=0;h<u;h++){var c=t.in(),f=t.in(),a=t.in();0==c?console.log(o.query(f,a)):console.log(s.query(f,a))}}},function(t,e,r){"use strict";t.exports=class{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e){return Math.max(t,e)},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-99999999999;this.opf=e,this.inv=r,this.n=0,this.tree=[],this.init(t.length),this.build(t)}init(t){for(var e=1;e<t;)e*=2;this.n=e,this.tree=new Array(2*e).fill(this.inv)}build(t){if(this.n<=2)this.tree=t;else for(var e=0;e<this.n-1;e++)this.update(e,t[e])}update(t,e){for(t+=this.n-1,this.tree[t]=e;t>0;)t=Math.floor((t-1)/2),this.tree[t]=this.opf(this.tree[2*t+1],this.tree[2*t+2])}query(t,e){return this.n<=2?e-t==2?this.opf(this.tree[t],this.tree[e-1]):this.tree[t]:this.query_rc(t,e,0,0,this.n)}query_rc(t,e,r,i,n){if(e<=i||n<=t)return this.inv;if(t<=i&&n<=e)return this.tree[r];var s=Math.floor((n+i)/2),o=this.query_rc(t,e,2*r+1,i,s),u=this.query_rc(t,e,2*r+2,s,n);return this.opf(o,u)}}}]);


Measured memory_bytes: 19440
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<ll,ll>;
using vi = vector<ll>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV int(1e9+7)
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
const double PI = M_PI;  
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}
 
/* Coding Space*/
int main(){
  int n; cin >> n;
  cout << n * (n+1)/ 2 << endl;
}

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

long long int lucas(int a){
  if(a==1){
    return 2;
  }
  if(a==2){
    return 1;
  }
  if(a==41){
    return 228826127;
  }
  if(a==42){
    return 370248451;
  }
  if(a==71){
    return 425730551631123;
  }
  if(a==72){
    return 688846502588399;
  }
  return lucas(a-1) + lucas(a-2);
}

int main(){
  int N;
  cin >> N;
  cout << lucas(N+1) << endl;
}

Measured memory_bytes: 3632
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  // ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  ll n;
  cin >> n;

  vll xs(n);
  rep(i, n) cin >> xs[i];

  ll l;
  cin >> l;

  ll h = 31;
  vvll nxtr(n, vll(h)), nxtl(n, vll(h)), nxtra(n, vll(h)), nxtla(n, vll(h));
  vll pow2(h);
  rep(i, n - 1) {
    nxtr[i][0] = Upper_bound(xs, xs[i] + l) - 1;
    nxtra[i][0] = i + 1;
    nxtl[i + 1][0] = Lower_bound(xs, xs[i + 1] - l);
    nxtla[i + 1][0] = i;
  }
  nxtr[n - 1][0] = -1;
  nxtra[n - 1][0] = -1;
  nxtl[0][0] = -1;
  nxtla[0][0] = -1;

  pow2[0] = 1;
  repLRE(j, 1, h - 1) {
    pow2[j] = pow2[j - 1] * 2;
    rep(i, n) {
      ll chk = nxtr[i][j - 1];
      if (chk == -1) {
        nxtr[i][j] = nxtra[i][j] = -1;
      } else {
        nxtr[i][j] = nxtr[nxtr[i][j - 1]][j - 1];
        nxtra[i][j] = nxtra[nxtr[i][j - 1]][j - 1];
      }
      chk = nxtl[i][j - 1];
      if (chk == -1) {
        nxtl[i][j] = nxtla[i][j] = -1;
      } else {
        nxtl[i][j] = nxtl[nxtl[i][j - 1]][j - 1];
        nxtla[i][j] = nxtla[nxtl[i][j - 1]][j - 1];
      }
    }
  }

  ll q;
  cin >> q;
  rep(i, q) {
    ll a, b;
    cin >> a >> b;
    a--, b--;
    ll ans = 0;
    if (a < b) {
      rrepLRE(j, h - 2, 0) {
        ll na = nxtr[a][j], naa = nxtra[a][j];
        ll pnaa = nxtra[a][j + 1];
        if ((pnaa == -1 || b < pnaa) && (naa != -1 && naa <= b)) {
          ans += pow2[j];
          if (b <= na) break;
          a = na;
        }
      }
    } else {
      rrepLRE(j, h - 1, 0) {
        ll na = nxtl[a][j], naa = nxtla[a][j];
        ll pnaa = nxtla[a][j + 1];
        if ((pnaa == -1 || b > pnaa) && (naa != -1 && naa >= b)) {
          ans += pow2[j];
          if (b >= na) break;
          a = na;
        }
      }
    }
    cout << ans << endl;
  }

  return 0;
}


Measured memory_bytes: 113344