akhauriyash/Code-Regression huggingface dataset:
//set many funcs template
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384

int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}

int main(void){
    int i,j,n,m,k,a[262144],b,c,w,r=0,l,t;
    double d;
    char s[4][4];
    scanf("%s%s%s",s[0],s[1],s[2]);
    //l=strlen(s);
    //for(i=0;i<n;i++){scanf("%d",&a[i]);}
    //qsort(a,n,sizeof(int),sortfncsj);
    printf("%c%c%c\n",s[0][0],s[1][1],s[2][2]);
    return 0;
}

Measured memory_bytes: 128
package main

import (
	"bufio"
	_ "container/heap"
	"fmt"
	"math"
	"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

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	defer wtr.Flush()
	L := sc.nextFloat()
	q := math.Pow(L, 3)

	fmt.Fprintf(wtr, "%.12f\n", q/27.0)
}


Measured memory_bytes: 640
import java.io.{BufferedReader, InputStream, InputStreamReader, PrintWriter}
import java.util.StringTokenizer

import scala.collection.mutable
import scala.util.Sorting
import math.{abs, max, min}
import scala.collection.mutable.{ArrayBuffer, ListBuffer}

object Main {
  val MOD = 1000000007
  val out = new PrintWriter(System.out)
  def solve(): Unit = {
    val sc = new InputReader(System.in)
    val A, B, C = sc.nextInt()
    val Max = max(max(A, B), C)
    val ABC = ListBuffer(A, B, C)
    ABC -= Max
    val Seq(x, y) = ABC
    val dx = Max - x
    val dy = Max - y
    val odd = dx % 2 + dy % 2 match {
      case 0 => 0
      case 1 => 2
      case 2 => 1
    }
    val ans = dx / 2 + dy / 2 + odd

    out.println(ans)
  }


  def main(args: Array[String]): Unit = {
    solve()
    out.flush()
  }


  class InputReader(val stream: InputStream) {
    private val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer = null

    def next: String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next.toInt
    def nextLong(): Long = next.toLong
    def nextChar(): Char = next.charAt(0)
  }

  private def rep(n: Int)(f: Int => Unit): Unit = {
    (0 until n) foreach f
  }

  private def map[@specialized(Int, Long) A](n: Int)(f: Int => A): Seq[A] = {
    (0 until n) map f
  }
}


Measured memory_bytes: 25416
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(a);i>(b);--i)
#define eper(i,a,b) for(int i=(a);i>=b;--i)
#define fore(x, a) for(auto &x : a)
#define pb push_back
#define mp make_pair
#define INF 100100100100
#define inf 2001001001
#define MOD 1000000007
#define ALL(x) begin(x),end(x)
#define F first
#define S second
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using vii = vector<int>;
using vll = vector<ll>;
template<class T>using vv = vector<T>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
template<class T>void show(const vector<T> &a) { for (int i = 0; i < (int)a.size(); ++i) cout << a[i] << (i != (int)a.size()-1 ? " " : "\n"); }
template<class T>T gcd(T a, T b){ return b ? gcd(b, a % b) : a; }
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }
int dy[]={0, 1, -1, 0};
int dx[]={1, 0, 0, -1};

int n;
vii a;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    cin >> n;
    a.resize(n);
    ll ans = (ll)pow(3, n);
    int k = 0;
    rep(i, 0, n) {
      cin >> a[i];
      if (a[i] % 2 == 0) k++;
    }
    ans -= (ll)pow(2, k);
    cout << ans << endl;
    return 0;
}



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

int main()
{
   int k,a,b,flag=0;
   cin >> k >> a >> b;
    for (int i = a; i<=b ; ++i) {
        if(i%k==0)
        {
            flag=1;
            break;
        }
    }
    if (flag==1)
        cout << "OK" << endl;
    else
        cout << "NG" << endl;
}

Measured memory_bytes: 3636
import scala.io.StdIn._

object Main extends App {
  val n = readLong
  val limit = Math.sqrt(n).toInt + 1
  def check(d: Int, min: Long): Long = {
    if (d > limit) min
    else check(d + 1, if (n % d == 0) Math.min(min, n / d + d - 2) else min)
  }
  println(check(1, Long.MaxValue))
}

Measured memory_bytes: 25424
#include<bits/stdc++.h>
using namespace std;
#define int long long int
main()
{
 int x,steps ,d;
 cin>>x>>steps>>d;
 x=abs(x);
 if(x/d<steps)
 {
  int req=x/d;
  if((steps-req)%2==0)
  {//cout<<"1"<<endl;
  	cout<<abs(x-d*req)<<endl;
  }
  else
  {//cout<<"2"<<endl;
  	cout<<abs(x-d*(req+1))<<endl;
  }
 }
 else
 {//cout<<"3"<<endl;
 	cout<<abs(x-d*steps)<<endl;
 }
}


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

using pii = pair<int,int>;
using ll = long long;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()
#define debug(x) cerr << #x << " : " << x << endl

template<class T> bool set_min(T &a, const T &b) { return a > b  ? a = b, true : false; }
template<class T> bool set_max(T &a, const T &b) { return a < b  ? a = b, true : false; }
// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << "\t" << t; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << "<" << v.first << ", " << v.second << ">"; }

const int INF = 1 << 30;
const ll INFL = 1LL << 60;


class Solver {
  public:
    void solve(vector<vector<int>> &G, int N, int offset, int level) {
        if(N <= 1) return;
        // cerr << N << " " << offset << " " << level << endl;
        solve(G, N / 2, offset, level+1);
        solve(G, N / 2 + (N % 2 > 0), offset + N / 2, level+1);
        rep(i, N / 2) {
            repeat(j, N / 2, N) {
                if(G[i+offset][j+offset] > 0) cerr << i << " " << j << endl;
                assert(G[i+offset][j+offset] < 0);
                G[i + offset][j + offset] = level;
            }
        }
    }
    bool solve() {
        int N; cin >> N;
        vector<vector<int>> G(N, vector<int>(N, -1));
        solve(G, N, 0, 1);
        rep(i, N) {
            repeat(j, i + 1, N) cout << G[i][j] << (j + 1 == N ? "\n" : " ");
        }

        return 0;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    Solver s;
    s.solve();
    return 0;
}


Measured memory_bytes: 1536
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional>
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<ll,ll> P;
typedef pair<ll,ll> Pll;
//小数点以下　cout << fixed << setprecision(10) << num << endl;
//桁数はlog10(mid)でやれ　log(mid)/log(10)はWA
//long*long<0で判定するな
//開区間と閉区間
//アルファベットが何番目かは x=s[i]-'a'
//bfsはmain()内で　rep(i,h)rep(j,w)rep(i,4)でバグ
//切り上げ：(a+(b-1))/b
//32bit以上は 1ull<<j
// map 初期値0 for(auto itr=mp.begin();itr!=mp.end();++itr) itr->fi itr->se で全探索
// for(auto u:mp) u.fi u.se も可能
//n個のgcd,lcmは一つずつみて更新していく
//大きな数を扱うときは素因数分解した形で持っておく
// (l/a[i]) = l*powmod(a[i],MOD-2)%MOD;
//auto itr=lower_bound(ALL(a),key) a[itr-a.begin()]
int main(){
    string n;
    int k;
    cin >> n >> k;
    ll sz=n.size();
    ll ans=0;
    ll res=1;
    if(sz-1>=k){
        rep(i,k){
            res*=(sz-1-i);
        }
        rep(i,k){
            res/=(k-i);
        }
        res*=pow(9,k);
        ans+=res;
    }
    res=0;
    if(sz>=k){
        int x=n[0]-'0';
        if(k==2){
            res+=(x-1)*(sz-1)*9;
            for(int i=1;i<sz;i++){
                if((n[i]-'0')>0){
                    res+=(n[i]-'0');
                    res+=(sz-i-1)*9;
                    break;
                }
            }
        }else if(k==3){
            res+=(x-1)*81*(sz-1)*(sz-2)/2;
            bool ok=0;
            for(int i=1;i<sz;i++){
                if((n[i]-'0')>0){
                    res+=(sz-i-1)*(sz-i-2)*81/2;
                    res+=((n[i]-'0')-1)*(sz-i-1)*9;
                    for(int j=i+1;j<sz;j++){
                        if((n[j]-'0')>0){
                            res+=(n[j]-'0');
                            res+=(sz-j-1)*9;
                            ok=1;
                            break;
                        }
                    }
                    if(ok) break;
                }
            }
        }else{
            res=x;
        }
        ans+=res;
    }
    cout << ans << endl;
    
}


Measured memory_bytes: 384
#include <iostream>
#include<vector>
#include <cstdlib>
#include<cmath>
#include<string>
#include <iomanip>
#include <sstream>

using namespace std;


int main (){

  int n,i,j=0;

  string a[2];

  for(i=0;i<2;i++){

      cin>>a[i];

  }

  n=a[0].size();

  for(i=0;i<n;i++){

    if(a[0][i] != a[1][i]){


        j++;
    }


  }

  cout<<j;


}





























/*#include <iostream>
#include<vector>
#include <cstdlib>
#include<cmath>
#include<string>
#include <iomanip>
#include <sstream>

using namespace std;


int main (){


    unsigned long long n,i,j,m,cnt=0;

    cin>>n;

    vector<unsigned long long> a(n);

    stringstream s[n];

    string final[n];

    for(i=0;i<n;i++){

        cin>>a[i];
    }

    for(i=0;i<n;i++){

        s[i]<<a[i];
        s[i]>>final[i];

    }

    vector<long long>b(n,0);



    for(i=0;i<n;i++){

        m=final[i].size();

        for(j=0;j<m;j++){

            b[i]+=final[i][j]-'0';


        }



    }

    for(i=0;i<n;i++){


        cout<<b[i]<<endl;
    }



}
 */

Measured memory_bytes: 3864
#include<stdio.h>
#include<string.h>
#define MAX 100000

/* 構造体 */
typedef struct pn{
  char name[100];
  int t;
} P;

/* グローバル変数 */
P Q[MAX];
int head, tail, n;

/* キューの追加 */
void enqueue(P x){
  Q[tail] = x;
  tail = (tail+1) % MAX;
}

/* キューの取り出し */
P dequeue(){
  P x = Q[head];
  head = (head+1) % MAX;
  return x;
}

int min(int a,int b){
  if (a<b) return a;
  else return b;
}

int main(){
  int elaps = 0, c;
  int i,q;
  P u;
  scanf("%d%d",&n,&q);

  for(i=1;i<=n;i++){
    scanf("%s",Q[i].name);
    scanf("%d",&Q[i].t);
  }
  
  head = 1;
  tail = n+1;

  while(head != tail){
    u = dequeue();
    c = min(q,u.t);
    u.t -= c;
    elaps += c;
    if(u.t > 0) enqueue(u);
    else {
      printf("%s %d\n",u.name,elaps);
    }
  }
  
  return 0;
}



Measured memory_bytes: 11900
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, y = 0;
  cin >> N;
  
 
  // ここにプログラムを追記
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    if (S == "Y") {
      y++;               
    }          
  }
  if (y > 0) {
    cout << "Four" << endl;
  }
  else {
    cout << "Three" << endl;
  }
}

Measured memory_bytes: 256
//#pragma GCC target ("avx2")
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long

using namespace std;
using namespace __gnu_pbds;

template <class T> using ordered_set =
tree<T, null_type, less<T>,
rb_tree_tag, tree_order_statistics_node_update>;

const int N = (int)(1e6 + 5);
const int M = (int)(1e9 + 7);
const int INF = (int)(1e18 + 9);
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};

int a[N];

signed main() {
  ios_base :: sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int sum = 0;
  int mn = INF;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    sum += abs(a[i]);
    mn = min(mn, abs(a[i]));
  }
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] < 0)
      ++cnt;
  }
  if (cnt % 2 == 0)
    cout << sum;
  else
    cout << sum - 2 * mn;
  return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<cstdlib>
#include<vector>
#include<algorithm>
#include<functional>

#define REP(i,n) for(int i=0;i<n;i++)
#define ll long long int

using namespace std;

int to_int(string s) {
  return atoi(s.c_str());
}


int main() {
  int a[100];
  int n;
  cin >> n;
  REP(i,n) cin >> a[i];

  int max = -1, min = 2000000000;
  REP(i,n) {
    if(a[i] < min) {
      min = a[i];
    }
    if(a[i] > max) {
      max = a[i];
    }
  }

  cout << max - min << endl;
}


Measured memory_bytes: 256
use proconio::*;

fn calc(mut a: Vec<(u32, i32)>, item: (u32, i32)) -> Vec<(u32, i32)> {
    let mut b = a.iter().map(|a| (a.0 + item.0, a.1 + item.1)).filter(|p| p.1 <= 100000).collect::<Vec<_>>();
    let mut c = Vec::with_capacity(a.len() * 2);
    while !(a.is_empty() || b.is_empty()) {
        if a.last().unwrap().1 >= b.last().unwrap().1 {
            c.push(a.pop().unwrap());
        } else {
            c.push(b.pop().unwrap());
        }
    }
    for p in a.into_iter().chain(b.into_iter()).rev() {
        c.push(p);
    }
    c.reverse();
    let mut val = 0;
    for c in c.iter_mut() {
        val = std::cmp::max(val, c.0);
        c.0 = val;
    }
    c.dedup_by(|a, b| {
        if b.0 == a.0 || b.1 == a.1 {
            *b = (std::cmp::max(b.0, a.0), std::cmp::min(b.1, a.1));
            true
        } else {
            false
        }
    });
    c
}

#[fastout]
fn run() {
    input! {
        n: usize,
        mut item: [(u32, i32); n],
        q: usize,
        ask: [(usize, i32); q],
    }
    item.insert(0, (0, 0));
    let mut memo = vec![vec![]; n + 1];
    memo[1] = vec![(0, 0), item[1]];
    let batch = 11;
    for i in 2..=std::cmp::min(n, 1 << batch) {
        memo[i] = calc(memo[i / 2].clone(), item[i]);
    }
    for (start, width) in ask {
        let ans = if start < (1 << batch) {
            memo[start].iter().filter(|p| p.1 <= width).max().unwrap().0
        } else {
            let mut dp = vec![(0, 0)];
            let mut pos = start;
            while pos >= (1 << batch) {
                dp = calc(dp, item[pos]);
                pos /= 2;
            }
            let mut ans = 0;
            for &(v, w) in memo[pos].iter() {
                while let Some(p) = dp.last() {
                    if p.1 + w > width {
                        dp.pop();
                    } else {
                        break;
                    }
                }
                if let Some(p) = dp.last() {
                    ans = std::cmp::max(ans, v + p.0);
                }
            }
            ans
        };
        println!("{}", ans);
    }
}

fn main() {
    run();
}


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

int main() {
    ll N,P;
    cin >> N >>P;
    ll target =2;
    if(N==1){
        cout << P <<endl;
        return 0;
    }
    ll ans=1;
    ll P2 =P;
    while(P>=(target*target)){
        ll count=0;
        while(P%target==0){
            P/=target;
            count++;
            if(count==N){
                ans*=target;
                count =0;
            }
        }
        
        target++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Queue;

public class Main {
	static ContestScanner in;
	static Writer out;
	public static void main(String[] args) {
		Main main = new Main();
		try {
			in = new ContestScanner();
			out = new Writer();
			main.solve();
			out.close();
			in.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	void solve() throws IOException {
		int n = in.nextInt();
		long c = in.nextLong();
		long k = in.nextLong();
		long[] p = new long[n];
		for(int i = 0; i < n; i++) {
			long t = in.nextLong();
			p[i] = t;
		}
		Arrays.sort(p);
		int cnt = 0;
		for(int i = 0; i < n; i++) {
			int psg = 1;
			final long start = p[i] + k;
			while(i + 1 < n && psg < c && p[i + 1] <= start) {
				i++;
				psg++;
			}
			cnt++;
		}
		System.out.println(cnt);
	}
}

class Writer extends PrintWriter{
	public Writer(String filename)throws IOException
	{super(new BufferedWriter(new FileWriter(filename)));}
	public Writer()throws IOException{super(System.out);}
}
class ContestScanner implements Closeable{
	private BufferedReader in;private int c=-2;
	public ContestScanner()throws IOException 
	{in=new BufferedReader(new InputStreamReader(System.in));}
	public ContestScanner(String filename)throws IOException
	{in=new BufferedReader(new InputStreamReader(new FileInputStream(filename)));}
	public String nextToken()throws IOException {
		StringBuilder sb=new StringBuilder();
		while((c=in.read())!=-1&&Character.isWhitespace(c));
		while(c!=-1&&!Character.isWhitespace(c)){sb.append((char)c);c=in.read();}
		return sb.toString();
	}
	public String readLine()throws IOException{
		StringBuilder sb=new StringBuilder();if(c==-2)c=in.read();
		while(c!=-1&&c!='\n'&&c!='\r'){sb.append((char)c);c=in.read();}
		return sb.toString();
	}
	public long nextLong()throws IOException,NumberFormatException
	{return Long.parseLong(nextToken());}
	public int nextInt()throws NumberFormatException,IOException
	{return(int)nextLong();}
	public double nextDouble()throws NumberFormatException,IOException 
	{return Double.parseDouble(nextToken());}
	public void close() throws IOException {in.close();}
}

Measured memory_bytes: 40764
N = int(input())
e = [0]*(N+1)
for i in range(2,N+1) :
    cur = i
    for j in range(2,i+1) :
        while cur % j == 0 :
            e[j] += 1
            cur //= j
def num(m) :
    return len(list(filter(lambda x: x >= m-1, e)))

print(num(75) + num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)


Measured memory_bytes: 3188
#include <iostream>
#include <iomanip> //! for setprecision(10)
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long LL;

#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define rep(i,n) for (int i = 0; i < (n); ++i)

const int MOD = 1000000007;

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

    int N, M;
    cin >> N >> M;

    if (N % 2) {
        rep(i, M) {
            int distFrom1 = i+1;
            cout << (1+distFrom1) << ' ' << (N+1-distFrom1) << endl;
        }
    } else {
        int count = 0;
        for (int i = 0; count < M; ++i) {
            int l = N/2;
            int r = l+1;
            cout << (l-i) << ' ' << (r+i) << endl; 
            ++count;
            if (count < M) {
                int distFrom1 = i+1;
                cout << (1+distFrom1) << ' ' << (N+1-distFrom1) << endl;
                ++count;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
#define pb push_back
#define mp make_pair
#define pr pair<int, int>
#define x first
#define y second
using namespace std;

template<typename T>
void read(T& n){
	char ch; int sign = 1;
	while (!isdigit(ch = getchar())) if (ch == '-') sign = -1;
	n = ch - '0';
	while (isdigit(ch = getchar())) n = n * 10 + ch - '0';
	n *= sign;
}
typedef long long ll;
const int INF = 1e9 + 7;
const int N = 122222;
int r, c, n, x, y, p, q;
vector<pr> up, dn, lf, rt;
int stk[N], top;

void push(pr x){
	if (top&&stk[top] == x.y) top--;
	else stk[++top] = x.y;
}

int main(){
	read(r), read(c), read(n);
	rep(i, 1, n){
		read(x), read(y), read(p), read(q);
		if ((!x||x == r||!y||y == c)&&(!p||p == r||!q||q == c)){
			if (!x) up.pb(mp(y, i));
			else if (x == r) dn.pb(mp(y, i));
				else if (!y) lf.pb(mp(x, i));
					else if (y == c) rt.pb(mp(x, i));
			if (!p) up.pb(mp(q, i));
			else if (p == r) dn.pb(mp(q, i));
				else if (!q) lf.pb(mp(p, i));
					else if (q == c) rt.pb(mp(p, i));
		}
	}
	sort(up.begin(), up.end()), sort(dn.begin(), dn.end());
	sort(lf.begin(), lf.end()), sort(rt.begin(), rt.end());
	rep(i, 0, (int)up.size() - 1) push(up[i]);
	rep(i, 0, (int)rt.size() - 1) push(rt[i]);
	per(i, (int)dn.size() - 1, 0) push(dn[i]);
	per(i, (int)lf.size() - 1, 0) push(lf[i]);
	puts(top ? "NO" : "YES");
	return 0;
}

Measured memory_bytes: 2584
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args){
		try {
			BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
			String line;
			while ((line = stdReader.readLine()) != null){
				String[] temp = line.split(" ");
				sortAndPut(temp);
			}
		} catch (Exception e) {
			e.getStackTrace();
			System.exit(0);
		}
	}

	private static void sortAndPut(String[] temp){
		int a = Integer.parseInt(temp[0]);
		int b = Integer.parseInt(temp[1]);
		int c = Integer.parseInt(temp[2]);
		if(b > c){
			int work = b;
			b = c;
			c = work;
		}
		if(a > b){
			int work = a;
			a = b;
			b = work;
		}
		if(b > c){
			int work = b;
			b = c;
			c = work;
		}
		System.out.println(a+" "+b+" "+c);
	}
}

Measured memory_bytes: 24228
#include <stdio.h>
#include<math.h>

int main(void)
{
	double a, b, c, d, e, f;
	double A, B, C, D;
	double x, y;
	while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f)!=EOF) {
		A=c*e-b*f; B=a*e-b*d;
		C=c*d-a*f; D=b*d-a*e;
		x=A/B; y=C/D;
		if(x==-0) x=0;
		if(y==-0) y=0;
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}


Measured memory_bytes: 652
import java.util.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Collections;


public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] xy = br.readLine().split(" ");
        long x = Long.parseLong(xy[0]);
        long y = Long.parseLong(xy[1]);
        
        int count = 1;
        for (int i = 1; ;i++) {
            x *= 2;
            if (x <= y) count++;
            else break;
        }
        System.out.println(count);
        
    }
}

class Box {
    int w;
    int h;
    public Box(int w, int h) {
        this.w = w;
        this.h = h;
    }
}

class BoxComparator1 implements Comparator<Box>{
	public int compare(Box b1, Box b2) {
		return b1.w - b2.w;
	}
}

class BoxComparator2 implements Comparator<Box> {
    public int compare(Box b1, Box b2) {
        return b1.h - b2.h;
    }
}


Measured memory_bytes: 22996
// 参考
// https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// Input macro
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! stdin {
    () => {{
        use std::io::Read;
        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }};
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

// Test Code
macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r"3 4
" => r"Even",

r"1 21
" => r"Odd"
}

use std::cmp;
use std::collections::HashSet;
use std::f32::MAX;

fn main() {
    println!("{}", solve(&stdin!()));
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        a: i32,
        b: i32
    }

    if a * b % 2 == 1 {
        "Odd".to_string()
    } else {
        "Even".to_string()
    }
}


Measured memory_bytes: 4352
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
template<class T> bool INRANGE(T x,T a,T b) { return a<=x&&x<=b; }
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(v) (v).begin(),(v).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;


typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

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


    int N;
    cin >> N;

    double t, ans = 0;
    string st;
    REP(i,N) {
        cin >> t >> st;
        if (st == "JPY") ans += t;
        else ans += t/0.0001*(38.0);
    }

    cout << ans << endl;

    return 0;
}

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

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

  unordered_map<ll, int> factors;

  while (n % 2LL == 0) {
    n /= 2LL;
    factors[2LL]++;
  }

  for (ll i = 3LL; i * i <= n; i += 2) {
    while (n % i == 0) {
      n /= i;
      factors[i]++;
    }
  }

  if (n != 1) factors[n]++;

  ll ans = 0;

  for (auto f: factors) {
    int e = 1LL;
    while (f.second >= e) {
      ans++;
      f.second -= e;
      e++;
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3632
#include <algorithm>
#include <utility>
#include <vector>

using ll = long long;

using namespace std;

vector<pair<int, int>> vec;

ll h, w, n;
ll ans[10];

const pair<int, int>diff[9] = { {-1,-1},{-1,0},{-1,1},{1,-1},{1,0},{1,1},{0,-1},{0,0},{0,1} };

ll surnum(ll y,ll x)
{
	if (y < 1 || h <= y + 1)return 0;
	if (x < 1 || w <= x + 1)return 0;
	ll count = 0;
	for (ll i = 0; i < 9; ++i)
	{
		if (binary_search(vec.begin(), vec.end(), make_pair(y + diff[i].first, x + diff[i].second), [](const pair<int, int>&a_, const pair<int, int>&b_) {if (a_.first == b_.first)return a_.second < b_.second; else return a_.first < b_.first; }))
		{
			++count;
		}
	}
	return count;
}

int main()
{
	scanf("%d %d %d", &h, &w, &n);
	for (ll i = 0; i < n; ++i)
	{
		ll a, b;
		scanf("%d %d", &a, &b);
		--a; --b;
		vec.emplace_back(a, b);
	}
	sort(vec.begin(), vec.end(), [](const pair<int, int>&a_, const pair<int, int>&b_) {if (a_.first == b_.first)return a_.second < b_.second; else return a_.first < b_.first; });
	for (ll i = 0; i < n; ++i)
	{
		for (int d = 0; d < 9; ++d)
		{
			ll ret = surnum(vec[i].first + diff[d].first, vec[i].second + diff[d].second);
			++ans[ret];
		}
	}
	ll total = (h - 2) * (w - 2);
	ll notzero = 0;
	for (ll j = 1; j < 10; ++j)
	{
		ans[j] /= j;
		notzero += ans[j];
	}
	ans[0] = total - notzero;
	for (ll j = 0; j < 10; ++j)
	{
		printf("%lld\n",ans[j]);
	}
	return 0;
}

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

int main() {
  int N, L;
  cin >> N >> L;
  string S[N];
  for (int i = 0; i < N; i++) cin >> S[i];
  sort(S, S + N);

  string result;
  for (int i = 0; i < N; i++) result += S[i];
  cout << result << endl;
}


Measured memory_bytes: 3624
#include <iostream>
#include <vector>

int main() {
	int n, temp;
	int result = 0;
	std::vector<int> v;
	std::vector<int> c;

	std::cin >> n;

	for (int i = 0; i < n; i++) {
		std::cin >> temp;
		v.push_back(temp);
	}

	for (int i = 0; i < n; i++) {
		std::cin >> temp;
		c.push_back(temp);
	}

	for (int i = 0; i < n; i++) {
		if (c.at(i) - v.at(i) <= 0) {
			result += v.at(i) - c.at(i);
		}
	}
	std::cout << result << std::endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define fi first
#define sc second
#define pb push_back
#define COUT(x) cout << (x) << "\n"
#define COUTF(x) cout << setprecision(15) << (x) << "\n"
#define ENDL cout << "\n"
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SZ(x) (ll) x.size()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define MAX(x, y, z) max(a, max(b, c))
#define MIN(x, y, z) min(a, min(b, c))
#define ANS cout << ans << "\n"
#define RETURN(x)    \
  cout << x << "\n"; \
  return 0
clock_t CLOCK;
#define START_TIMER CLOCK = clock()
#define SHOW_TIMER cerr << "time: " << (ld)(clock() - CLOCK) / 1000000 << "\n"
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define LINE cerr << "[debug] line: " << __LINE__ << "\n";
#define debug(x) cerr << "[debug] " << #x << ": " << x << "\n";
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << "\n";
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll, ll>;
using qll = queue<ll>;
using P = pair<ll, ll>;

constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

signed main() {
  init();
  string N;
  cin >> N;
  if (N[0] == '9' || N[1] == '9') {
    COUT("Yes");
  } else {
    COUT("No");
  }
  return 0;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<pair<ll, ll>> pll;
 
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define popcount(x) __builtin_popcountll(x)
 
const long double PI = acos(-1);
 
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}
bool isInteger(double x){return floor(x) == x;}


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

  string s;
  cin >> s;
  if(s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PI 4*atan(1.0)
typedef long long ll;
typedef long double ld;
using namespace std;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};

int main(){
	stack<int> sta;
	char s[11];
	cin>>s;
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='B'){
			if(sta.size())
				sta.pop();
		}
		else
			sta.push(s[i]-'0');
	}
	stack<int> sta2;
	while(sta.size()){
		sta2.push(sta.top());
		sta.pop();
	}
	while(sta2.size()){
		cout<<sta2.top();
		sta2.pop();
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>

unsigned long x,y;

void solve();
int main(){
  scanf("%ld",&x);
  scanf("%ld",&y);
  solve();
  return 0;
}

void solve(){
  int count = 0;
  unsigned long key = x;
  while(key<=y){
    count+=1;
    key=key*2;
  }
  printf("%d\n",count);
  return;
}

Measured memory_bytes: 128
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//# include <x86intrin.h>
# include <bits/stdc++.h>

//# include <ext/pb_ds/assoc_container.hpp>
//# include <ext/pb_ds/tree_policy.hpp>

//using namespace __gnu_pbds;
using namespace std;
 
//template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
 
int n, m, k;
map <ll, ll > was;


int main () {
	SpeedForce;

	vector < ll > all;
	cin >> k;
	for (int i = 1; i <= 9; ++i) {
		all.pb(i);
	}
	if (sz(all) > k) {
		cout << all[k-1];
		exit(0);
	}
	int ptr = 0;
	while(ptr < sz(all)) {
		if (sz(all) > k) {
			cout << all[k-1];
			exit(0);
		}
		ll v = all[ptr++];
		ll lst = v % 10;
		for (int dif = 0; dif <= 9; ++dif) {
			if(abs(dif - lst) <= 1) {
				ll nxt = v * 10 + dif;
				all.pb(nxt);
			}
		}
	}



	return Accepted;
}

// B...a

Measured memory_bytes: 1400
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
#include<cstring>
#include<utility>
#include<cmath>
#include<assert.h>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>

#define int long long
using namespace std;
#define rep(i, n) for(int i=0;i<(n);++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound

int dp[64][3];
const int mod = 1000000007;

signed main() {
    int N;
    cin >> N;
    dp[63][0] = 1;
    for (int i = 62; i >= 0; --i) {
        rep(s, 3) {
            rep(k, 3) {
                int s2 = 2 * s + ((N >> i) & 1) - k;
                if (s2 < 0)break;
                if (s2 > 2)s2 = 2;
                dp[i][s2] += dp[i + 1][s];
                dp[i][s2] %= mod;
            }
        }
    }
    cout << (dp[0][0] + dp[0][1] + dp[0][2]) % mod << endl;
    return 0;
}


Measured memory_bytes: 256
#include<algorithm>
#include<complex>
#include<ctype.h>
#include<iomanip>
#include<iostream>
#include<map>
#include<math.h>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<string>
#include<string>
#include<vector>

using namespace std;
typedef long long ll;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")

const ll mod = 1e9 + 7;
const ll inf = 1e18;

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

    // input
    ll H, W;
    cin >> H >> W;

    FOR(i, 0, H){
        string s;
        cin >> s;
        p(s);
        p(s);
    }
    
    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;

ll DENOM = 1000000000LL + 7LL;
ll DEN2 = 998244353LL;

using namespace std;

ll n, m, k;
ll h, w;

ll calc_gcd(ll a, ll b){
    if (a<b){
        ll c = a;
        a = b;
        b = c;
    }
    while(a%b != 0){
        ll c = b;
        b = a%b;
        a = c;
    }
    return b;
}

int main(){
    ll x;
    cin >> n >> x >> m;
    vector<ll> fc(m,-1);
    ll rep = m-1;
    ll fs = 0;
    vector<ll> val(2*m);
    for(int i=0; i<2*m;++i){
        if(fc[x] != -1){
            rep = i - fc[x];
            fs = fc[x];
            break;
        }
        fc[x] = i;
        val[i] = x;
        x = (x*x) % m;
    }
    ll ret = 0;
    if(n < fs){
        ret = accumulate(val.begin(), val.begin()+n, 0LL);
    }else{
        n -= fs;
        ret += accumulate(val.begin()+fs, val.begin()+rep+fs, 0LL) * (n / rep);
        ret += accumulate(val.begin(), val.begin()+(n%rep)+fs, 0LL);
    }
    cout << ret << endl;
    return 0;
}


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

using namespace std;

using l = long;
using ll = long long;
using vd = vector<double>;
using vvd = vector<vector<double>>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using pii = vector<pair<int, int>>;

int main()
{
	ll H, W, res;
	cin >> H >> W;
	if (H == 1 || W == 1) {
		cout << 1;
		return 0;
	}
	res = (res = H * W) % 2 == 0 ? res / 2 : (res / 2) + 1;
	
	cout << res;
	
	
	return 0;
}

Measured memory_bytes: 256
/*Stay true to yourself, yet always be open to learn. Work hard, and never give up on your dreams, 
even when nobody else believes they can come true but you. These are not cliches but real tools you 
need no matter what you do in life to stay focused on your path.
*/
 
 /*Pppppppp    UU      UU     CCCCCCCC    CCCCCCCC     HH     HH     UU      UU
   pp    pp    UU      UU     CC          CC           HH     HH     UU      UU
   pp    pp    UU      UU     CC          CC           HHHHHHHHH     UU      UU
   pppppppp    UU      UU     CC          CC           HHHHHHHHH     UU      UU
   pp          UU      UU     CC          CC           HH     HH     UU      UU
   pp          UUUUUUUUUU     CCCCCCCC    CCCCCCCC     HH     HH     UUUUUUUUUU
   */
 
#include <bits/stdc++.h>
using namespace std;

#define int long long
typedef long long ll;
#define loop(i,n)  for(int i=0;i<n;i++)
#define ford(i,a,b) for(int i=b;i>=a;i--)
#define read(a) int a; cin >>a;
#define readarr(a,n) int a[n] ; for(int i=0;i<n;i++) cin >> a[i];
#define readmat(a,n,m) int a[n][m]; for(int i=0;i<n;i++) for(j=0;j<m;j++) cin >> a[i][j];
#define pb push_back
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int,int>
#define vii vector<vector<int>>
#define sti set<int>
#define vpi vector<pair<int,int>>
#define print(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl;
#define printmat(a,n,m) for(int i=0;i<n;i++) {for(j=0;j<m;j++) cout<<a[i][j]<<" "; cout<<endl;}
#define fast ios_base::sync_with_stdio(false);  cin.tie(NULL);
const ll inf = 1e18;
const ll mod = 1e9 + 7;

bool sortbysec(const pair<int, int>& a, 
               const pair<int, int>& b) 
{ 
    return (a.second < b.second); 
}
signed main()
{
    fast;
    read(n);
    pi p[n];
    loop(i,n){
        int x ,l;
        cin >> x>>l;
        p[i].first=x-l;
        p[i].second=x+l;
    }
    sort(p,p+n);
    int d=0;
    int r1 = p[0].second;
    for (int i = 1; i < n; i++) { 
        int l1 = p[i].first; 
        int r2 = p[i].second;
        if (l1 < r1) { 
            r1 = min(r1,r2);
            d++;
        } 
        else
        r1=r2;
    } 
    cout<<n-d<<endl;

    return 0;
}

Measured memory_bytes: 1792
def partition(a, left, right):
    pivot = a[right-1]
    i = left - 1
    for j in range(left, right-1):
        if a[j] <= pivot:
            i += 1
            a[i], a[j] = a[j], a[i]
    a[i+1], a[right-1] = a[right-1], a[i+1]
    return i + 1
 
def main():
    n = int(input())
    a = list(map(int, input().split()))
    p = partition(a, 0, len(a))
    a[p] = '[' + str(a[p]) + ']'
    print(' '.join(map(str, a)))
 
if __name__ == '__main__':
    main()


Measured memory_bytes: 16392
// ABC047A - 

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

typedef unsigned long long int ull;
typedef long long int ll;

int main() {
	int a[3];
	cin >> a[0] >> a[1] >> a[2];

	sort(a, a + 3);

	if (a[0] + a[1] == a[2]) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
using P = pair <int, int>;
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; }
ll gcd(ll a,ll b) {return  b ? gcd(b,a%b) : a;}
const long long INF = 1LL << 60;
const int mod = 1000000007;
const double PI = acos(-1.0);
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};

int main () {
     ll a,b;
     cin >> a>>b;
     ll A,B;
     if(a%2==0&&b%2==0){
          if((b-a)/2%2==0){
               cout << b <<endl;
               return 0;
          }
          else {
               ll ans = b^1;
               cout << ans <<endl;
               return 0;
          }
     }
     if(a%2==0&&b%2==1){
          if((b-a+1)/2%2==0){
               cout << 0 <<endl;
               return 0;
          }
          else {
               cout << 1 <<endl;
               return 0;
          }
     }
     if(a%2==1&&b%2==0){
          if((b-1-a)/2%2==0){
               ll ans = a^b;
               cout << ans <<endl;
               return 0;
          }
          else {
               ll ans = a^b^1;
               cout << ans <<endl;
               return 0;
          }
     }
     if(a%2==1&&b%2==1)
     {
          if((b-a)/2%2==0){
               cout << a<<endl;
               return 0;
          }
          else{
               ll ans = a^1; 
               cout << ans <<endl;
          return 0;}
     }
}

Measured memory_bytes: 3604