akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define show(x) cout << #x << " = " << (x) << endl
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl
#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl
#define showv(v) rep(i,v.size()) printf("%d%c", v[i], i==v.size()-1?'\n':' ')
#define showv2(v) rep(j,v.size()) showv(v[j])
#define showt(t,n) rep(i,n) printf("%d%c", t[i], i==n-1?'\n':' ')
#define showt2(t,r,c) rep(j,r) showt(t[j],c)
#define showvp(p) rep(i,p.size()) printf("%d %d\n", p[i].first, p[i].second);
#define printv(v) rep(i,v.size()) printf("%d\n", v[i])
#define printt(t,n) rep(i,n) printf("%d\n", t[i])
#define incl(v,x) find(rng(v),x)!=v.end()
#define incls(s,c) s.find(c)!=string::npos
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define bit(n,k) ((n>>k)&1) // nのk bit目
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
using vt = vector<T>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = (1<<30)-1;
//const ll INF = (1LL<<62)-1;
#define dame { puts("No"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
//inline int in() { int x; scanf("%d",&x); return x;}
template<class T = int> inline T in() { T x; cin >> x; return (x);}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main () {
  int n;
  string s;
  cin >> n >> s;
  ll ans = 0;
  for (int i = 0; i <= 999; ++i) {
    int c[3] = {i/100, (i/10)%10, i%10};
    int f = 0;
    for (int j = 0; j < n; ++j) {
      if (s[j] == ('0' + c[f])) f++;
      if (f == 3) break;
    }
    if (f == 3) ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;

int a[200007];
int main(){

   int n,ans = 0,minx = 2e5+7;

   cin >> n;
   for(int i = 0;i < n;i++){
        cin >> a[i];
        int t = minx;
        minx = min(a[i],minx);
        if(minx!=t) ans++;
   }
   cout << ans;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
 
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>
 
using namespace std;

void solve(){

	return;
}
 
int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	
	char c;

	cin >> c;
	cout << char(c+1) << endl;
	return 0;
}

Measured memory_bytes: 256
use strict;
use warnings;
package SuffixArray;
sub sa_is(\@$);
sub sa_is(\@$){
	my@s=@{$_[0]};
	my$upper=$_[1];
	my$n=@s;
	return(0)x$n if$n<=1;
	my@sa;
	my@ls;
	for(my$i=$n-2;$i>=0;$i--){
		$ls[$i]=$s[$i]==$s[$i+1]?$ls[$i+1]:$s[$i]<$s[$i+1];
	}
	my@sum_l=(0)x($upper+1);
	my@sum_s=(0)x($upper+1);
	$ls[$_]?$sum_l[$s[$_]+1]++:$sum_s[$s[$_]]++for 0..$n-1;
	for(0..$upper){
		$sum_s[$_]+=$sum_l[$_];
		$sum_l[$_+1]+=$sum_s[$_]if$_<$upper;
	}
	my$induce;
	$induce=sub{
		my@sa=(-1)x$n;
		my@buf=@sum_s;
		for(@_){
			next if$_==$n;
			$sa[$buf[$s[$_]]++]=$_;
		}
		@buf=@sum_l;
		$sa[$buf[$s[$n-1]]++]=$n-1;
		for(@sa){
			$sa[$buf[$s[$_-1]]++]=$_-1if$_>=1&&!$ls[$_-1];
		}
		@buf=@sum_l;
		for(my$i=$n-1;$i>=0;$i--){
			my$v=$sa[$i];
			$sa[--$buf[$s[$v-1]+1]]=$v-1if$v>=1&&$ls[$v-1];
		}
		return@sa;
	};
	my@lms_map=(-1)x($n+1);
	my$m=0;
	my@lms;
	for(1..$n-1){
		if(!$ls[$_-1]&&$ls[$_]){
			$lms_map[$_]=$m++;
			push@lms,$_;
		}
	}
	@sa=$induce->(@lms);
	if($m>0){
		my@sorted_lms=grep$lms_map[$_]!=-1,@sa;
		my@rec_s;
		my$rec_upper=0;
		$rec_s[$lms_map[$sorted_lms[0]]]=0;
		for(1..$m-1){
			my$l=$sorted_lms[$_-1];
			my$r=$sorted_lms[$_];
			my$end_l=$lms_map[$l]+1<$m?$lms[$lms_map[$l]+1]:$n;
			my$end_r=$lms_map[$r]+1<$m?$lms[$lms_map[$r]+1]:$n;
			my$same=1;
			if($end_l-$l!=$end_r-$r){
				$same=0;
			}
			else{
				$l++,$r++while$l<$end_l&&$s[$l]==$s[$r];
				$same=0if$l==$n||$s[$l]!=$s[$r];
			}
			$rec_upper++if!$same;
			$rec_s[$lms_map[$sorted_lms[$_]]]=$rec_upper;
		}
		my@rec_sa=sa_is(@rec_s,$rec_upper);
		$sorted_lms[$_]=$lms[$rec_sa[$_]]for 0..$m-1;
		@sa=$induce->(@sorted_lms);
	}
	return@sa;
}
sub suffix_array(\$){
	my@s=map ord,split"",${$_[0]};
	return sa_is(@s,255);
}
package LcpArray;
sub lcp(\@\@){
	my@s=@{$_[0]};
	my$n=@s;
	my@sa=@{$_[1]};
	my@rnk;
	$rnk[$sa[$_]]=$_ for 0..$n-1;
	my@lcp;
	my$h=0;
	for(0..$n-1){
		$h--if$h>0;
		next if$rnk[$_]==0;
		my$j=$sa[$rnk[$_]-1];
		$h++while$j+$h<$n&&$_+$h<$n&&$s[$j+$h]==$s[$_+$h];
		$lcp[$rnk[$_]-1]=$h;
	}
	return@lcp;
}
sub lcp_array(\$\@){
	my@s=map ord,split"",${$_[0]};
	return lcp(@s,@{$_[1]});
}
package main;
my$s=<>;
chomp$s;
my@sa=SuffixArray::suffix_array($s);
my@lcp=LcpArray::lcp_array($s,@sa);
my$ans=@sa*(@sa+1)/2;
$ans-=$_ for@lcp;
print$ans,$/;


Measured memory_bytes: 252116
n=int(input())
a=[int(j) for j in input().split()]
from collections import Counter
c=Counter()
for i in a:
    c[i]+=1
ans=0
for i in c:
    ans+=c[i]*(c[i]-1)//2
for i in a:
    print(ans-c[i]*(c[i]-1)//2+(c[i]-1)*(c[i]-2)//2)

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

using namespace std;

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

    int left = 0;
    while (s[left] != 'A') {
        left++;
    }

    int right = s.size() - 1;
    while (s[right] != 'Z') {
        right--;
    }

    cout << (right - left + 1) << endl;
}


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

int main() {
  int A , B , C , D ;
  cin >> A >> B >> C >> D ;
  if ((A+B) > (C+D)){
    cout << "Left" << endl;
  }
  else if ((A+B) == (C+D)) {
    cout << "Balanced" << endl;
  }
  else {
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){

	int a,b,c,data=0,lop,fg=0;

	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);

	for(lop=0;lop<10000;lop++){
		data+=a;
		if(data%b==c){
			fg=1;
		}
	}
	
	
	if(fg==1){
		printf("YES\n");
	}else{
		printf("NO\n");
	}
	
	return 0;
}
			

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

int main()
{
  	int alpha[26] = {0};
  	string s;
  
 	while(getline(cin,s)){
      for(int i = 0;i < s.length();i++){
        if(isalpha(s.at(i))){
    	  	s.at(i) = tolower(s.at(i));
    	    alpha[s.at(i) - 'a']++;
        }
      }
    }
   	
  
  	char ch = 'a';
  	for(int i = 0;i < 26;i++){
      cout << ch++ << " : " << alpha[i] << endl;
    }

}


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

using ll = long long;

#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a.size())
#define clr(a, b) memset(a, b, sizeof(a))
#define REP(i, a, b) for(int i=(int)(a); i<(int)(b); ++i)
#define REPD(i, a, b) for(int i=(int)(a)-1; i>=(int)(b); --i)

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    int h = abs(h1-h2)*60 - m1 + m2;
    cout << h - k << "\n";
    return 0;
}


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

using namespace std;
int main() {
  string s;
  cin >> s;
  int sum = 0;
  for (int i = 0; i < 3; i++) {
  	sum += (int)s[i];
  }
  if (sum == (int)'a' + (int)'b' + (int)'c') {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
import random
import copy
import time
def evaluateSatisfaction(d, c, s, ans):
    score = 0
    last = [-1 for i in range(26)]
        
    for i in range(d):
        
        score += s[i][ans[i]]
        last[ans[i]] = i
        for j in range(26):
            if j != ans[i] or True:
                score -= c[j]*(i - last[j])
    return score
    
def valuationFunction(d,c,s,contestType,day,last):
    
    gain = s[day][contestType]
    #78 =  (1/2) * ((13*13) - 13)
    lost = c[contestType] * (78)
    return gain - lost

def Input():
    d = int(input())
    c = list(map(int, input().split()))
    s = [list(map(int, input().split())) for i in range(d)]
    #s[3][25] =   contest(25+1) of day(3+1)
    return d, c, s

def evolution(d, c, s, ans):
    score_before = evaluateSatisfaction(d, c, s, ans)
    ans_after = copy.copy(ans)

    idx1 = random.randint(0,d-1)
    idx2 = random.randint(0,d-1)
    
    tmp = ans_after[idx1]
    ans_after[idx1] = ans_after[idx2]
    ans_after[idx2] = tmp

    score_after = evaluateSatisfaction(d,c,s,ans_after)

    if score_after > score_before:
        return ans_after
    else:
        return ans

if __name__ == "__main__":
    
    d, c, s = Input()
    
    #print("val =", evaluateSatisfaction(d, c, s, [1, 17, 13, 14, 13]))

    #calc start
    t1 = time.time()
    ans = [0 for i in range(d)]
    last = [-1 for i in range(26)]
    for i in range(d):
        evalValueList = [0 for j in range(26)]
        for j in range(26):
            evalValueList[j] = valuationFunction(d, c, s, j,i,last)

        max_idx = 0
        max = evalValueList[0]

        for j in range(26):
            if (max < evalValueList[j]):
                max_idx = j
                max = evalValueList[j]
        
        ans[i] = max_idx
        last[ans[i]] = i


    
    #ans = [1, 2, 3, 4, 5]
    t2 = time.time()
    while(float(t2-t1) < 1.0):
        ans = evolution(d, c, s, ans)
        #print("ans = ",evaluateSatisfaction(d,c,s,ans))
        t2 = time.time()
    for x in ans:
        print(x + 1)
    #print(evaluateSatisfaction(d,c,s,ans))

Measured memory_bytes: 10088
n, k = map(int, input().split())
h = [int(i) for i in input().split()]

dp = [0] * n

for i in range(1, n):
  dp[i] = min([dp[i-j]+abs(h[i]-h[i-j]) for j in range(1, min(i, k)+1)])

print(dp[n-1])

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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

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

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 ll INF = 1e9+7;


int main(){
	//ios_base::sync_with_stdio(false);
	int A[2], ans=0;

	cin >> A[0] >> A[1];

	cout << 100 << " " << 100 << endl;

	int cnt[2] = {1,1};
	rep(i,100){
		rep(j,100){
			if( i % 2 || j % 2 ) cout << (i<50 ? '.' : '#');
			else{
				bool f = ( cnt[i<=50]++ < A[i<=50] );
				cout << ((i<50)^f ? '.' : '#');
			}
		}
		cout << endl;
	}

	return 0;
}

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

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

    int a = N;
    int keta = 0;

    while(a != 0){
        a /= 10;
        keta++;
    }

    int b = 0;
    a = N;

    for(int i = 0; i < keta; i++){
        b += a % 10;
        a /= 10;
    }

    if(N % b == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

}

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

int	main()
{
	int	n;
	cin >> n;
	map<char, vector<bool> > lost_cards;
	char	suits[] = "SHCD";
	for (int j = 0; j < 4; ++j)
		lost_cards[suits[j]] = vector<bool>(13, true);
	char	suit;
	int		rank;
	for (int i = 0; i < n; ++i) {
		cin >> suit >> rank;
		lost_cards.at(suit).at(rank - 1) = false;
	}
	for (int j = 0; j < 4; ++j) {
		for (int i = 0; i < 13; ++i) {
			if (lost_cards.at(suits[j]).at(i))
				cout << suits[j] << " " << i + 1 << endl;
		}
	}
}	


Measured memory_bytes: 3120
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

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

    double ans = 0;
    exrep(x, 1, n) {
        ll y = x;
        ll p = 1;
        while(y < k) {
            y *= 2;
            p *= 2;
        }
        ans += 1.0/(double)p;
    }
    ans *= 1.0/(double)n;
    
    exout(ans);
    re0;
}

Measured memory_bytes: 256
use std::io::{ stdin, stdout, BufRead, Write };

const SP   : u8 = b' ';
const LF   : u8 = b'\n';
const ZERO : u8 = b'0';

#[inline(always)]
fn uitoa(mut n: usize, buf: &mut Vec<u8>) {
  buf.clear();
  if n == 0 {
    buf.push(ZERO);
    return;
  }

  while n > 0 {
    buf.push((n % 10) as u8 + ZERO);
    n /= 10;
  }

  buf.reverse();
}

#[inline(always)]
fn atoui(s: &[u8]) -> usize {
  let mut n = 0;
  for b in &s[..] { n = n * 10 + (b - ZERO) as usize; }
  n
}

#[inline(always)]
fn vec_write_with(buf: &mut Vec<u8>, s: &mut Vec<u8>, b: u8) {
  s.push(b);
  buf.write(s).unwrap();
}

macro_rules! input {
  ($stdin:ident, $delim:expr, $buf:ident) => {
    {
      $buf.clear();
      let len = $stdin.read_until($delim, &mut $buf).unwrap();
      $buf.truncate(len - 1);
      atoui(&$buf)
    }
  };
}

macro_rules! subroutine {
  ($buf:ident, $ans:ident, $odd:ident, $n:ident, $i:ident, $j:ident, $x:ident, $y:ident, $num:ident) => {
    if $odd != 0 {
      uitoa($y + 1, &mut $num);
      vec_write_with(&mut $ans, &mut $num, SP);

      uitoa($x + 1, &mut $num);
      vec_write_with(&mut $ans, &mut $num, SP);

      uitoa($i + 1, &mut $num);
      vec_write_with(&mut $ans, &mut $num, SP);

      uitoa($j + 1, &mut $num);
      vec_write_with(&mut $ans, &mut $num, LF);

      $n += 1;
    }
    $odd ^= $buf[$j * 2] & 1;
    $y = $i;
    $x = $j;
  };
}

fn main() {
  let stdin = stdin();
  let mut stdin = stdin.lock();

  let mut buf = Vec::with_capacity(500 * 2);
  let h = input!(stdin, SP, buf);
  let w = input!(stdin, LF, buf);

  let mut num = Vec::with_capacity(3);
  let mut ans = Vec::new();
  let mut n   = 0;

  let mut odd = 0;
  let mut x   = 0;
  let mut y   = 0;

  for i in 0..h {
    buf.clear();
    stdin.read_until(LF, &mut buf).unwrap();

    if i % 2 == 0 {
      for j in 0..w {
        subroutine!(buf, ans, odd, n, i, j, x, y, num);
      }
    } else {
      for mut j in 0..w {
        j = w - 1 - j;
        subroutine!(buf, ans, odd, n, i, j, x, y, num);
      }
    }
  }

  let stdout = stdout();
  let mut stdout = stdout.lock();

  uitoa(n, &mut buf);
  buf.push(LF);
  stdout.write(&buf).unwrap();

  stdout.write(&ans).unwrap();
  stdout.flush().unwrap();
}


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

int main() {
  int A,B;
  cin >> A >> B;
  
  int a1,a2,b1,b2,a,b,aa,bb;
  a1 = A / 10000;
  a2 = A % 10000 / 1000;
  b1 = B / 10000;
  b2 = B % 10000 / 1000;
  a = (A / 100) * 100 + 10 * a2 + a1;
  b = (B / 100) * 100 + 10 * b2 + b1;
  
  if(A <= a)
    aa = 100 - A % 10000 / 100;
  else
    aa = 99 - A % 10000 / 100;
    
  if(B >= b)
    bb = B % 10000 / 100 + 1;
  else
    bb = B % 10000 / 100;
  
  cout << aa + bb + (B / 10000 - A / 10000 - 1) * 100 << endl;
  
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <numeric>
#include <algorithm>
#include <utility>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;


int gcd(int a, int b) {
    while (b != 0) {
        auto na = a % b;
        a = b;
        b = na;
    }
    return a;
}


void oneCase() {
    int a, b;
    cin >> a >> b;
    if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) {
        cout << "Possible" << "\n";
    } else {
        cout << "Impossible" << "\n";
    }
}


int main() {
    int t = 1;
//    cin >> t;
    while (t--) {
       oneCase();
    }

    return 0;
}

ll fact(ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        res = (res * n) % mod;
        --n;
    }
    return res;
}


Measured memory_bytes: 384
N = int(input())
a = list(map(int, input().split()))
S = [0]*N
S[0] = a[0]
for i in range(N-1):
    S[i+1] = a[i+1]+S[i]
ans = 10000000000
for i in range(N-1):
    ans = min(ans, abs(S[N-1]-S[i]-S[i]))
print(ans)

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

import sys
import datetime

"""
Input
    複数のデータセットを処理しなければなりません。
    １つのデータセットに月と日が１つのスペース区切られて１行に与えられます。
    月が 0 となったとき入力の最後とします
    （この場合は処理をしないでプログラムを終了させる）。

Output
    各データセットごとに曜日を英語で１行に出力して下さい。
    以下の訳を参考にして出力して下さい。

    Monday
    Tuesday
    Wednesday
    Thursday
    Friday
    Saturday
    Sunday
"""


def get_weekday(month, day):
    weekdays = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
    return weekdays[datetime.date(2004, month, day).weekday()]


def main():
    while 1:
        s = sys.stdin.readline()
        month, day = [int(x) for x in s.split(" ")]
        if month == 0:
            return
        print get_weekday(month, day)

if __name__ == '__main__':
    main()

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

int main(){
	int a, b, k;
	cin >> a >> b >> k;
	if(b-a+2>2*k){
		for(int i=0; i<k; i++){
			cout << a + i << endl;
		}
		for(int i=k; i>0; i--){
			cout << b - i + 1 << endl;
		}
	} else {
		for(int i=a; i<=b; i++){
			cout << i << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int x[45];

int fib(int n);

int main(void)
{
	int n, i;

	for (i = 0; i < 45; i++)
	{
		x[i] = -1;
	}

	scanf("%d", &n);
	printf("%d\n", fib(n));

	return 0;
}

int fib(int n){
	if (x[n] != -1){
		return x[n];
	}else if (n == 0 || n == 1){
		return 1;
	}else{
		x[n] = fib(n-1) + fib(n-2);
		return x[n];
	}
}

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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

auto print = [](auto &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
};

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll m, k;
  cin >> m >> k;
  VL ans;
  if(k >= pow(2, m)) {
    out(-1);
  }
  else if(m == 0 && k == 0) {
    cout << 0 << ' ' << 0 << endl;
  }
  else if(m == 1 && k == 1) {
    out(-1);
  }
  else if(m == 1 && k == 0) {
    cout << 0 << ' ' << 0 << ' ' << 1  << ' ' << 1 << endl;
  }
  else {
    for(int i = 0; i < pow(2, m); ++i) {
      if(i != k) ans.push_back(i);
    }
    ans.push_back(k);
    for(int i = (int)pow(2, m) - 1; i >= 0; --i) {
      if(i != k) ans.push_back(i);
    }
    ans.push_back(k);
    print(ans);
  }
  return 0;
}


Measured memory_bytes: 4080
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n;
        int x;
        int count;      
        while(true){
           n=sc.nextInt();
           x=sc.nextInt();
           count=0;
           if(n==0 && x==0){
              break;
           }
           for(int i=1;i<=n;i++){
               for(int j=1;j<=n;j++){
                   for(int k=1;k<=n;k++){
                     if(i+j+k==x){
                         if(i==j || i==k || j==k){
                         }
                         else{
                           count++;  
                         } 
                         
                     }
                   }
                }
            }
           System.out.println(count/6);
        }
    }
}


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

int main() {
  string s;cin>>s;
  vector<bool> vec(26);
  rep(i,26)vec[i]=false;
  rep(i,s.size()){
    vec[s[i]-'a']=true;
  }
  rep(i,26){
    if(vec[i])continue;
    else {
      cout<<(char)(i+'a')<<endl;
      return 0;
    }
  }
  cout<<"None"<<endl;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
int main()
{long long n;
int b=1;
int c=0;
int x=0;
cin>>n;
for(int i=0;i<n;i++){
    int m;
    cin>>m;
    if(m==1){
        x=x+1;
    }
    if(m==b){
        c=c+1;
        b=b+1;
    }
}
if(!x) cout<<-1; else
cout<<n-c;

    return 0;}

Measured memory_bytes: 256
/*=================================*\
                                   
      Md. Shahidul Islam           
         CSE, BRUR                 
      Rangpur, Bangladesh          
 mail: shahidul.cse.brur@gmail.com 
 FB  : fb.com/shahidul.brur        
 Blog: shahidul-brur.blogspot.com 
\*=================================*/
#include<bits/stdc++.h>
using namespace std;

#define ll       long long
#define ull      unsinged long long
#define vi       vector<int>
#define vll      vector<ll>
#define ii       pair<int, int>
#define vii      vector<pair<int, int> >
#define vs       vector<string>
#define vd       vector<double>
#define mii       map<int, int>
#define mli       map<ll, int>
#define msi       map<string, int>

#define pb              push_back
#define mp              make_pair
#define ff              first
#define ss              second
#define sz              size()
#define all(a)          a.begin(), a.end()
#define f(i, a, b)      for(int i=(a);i<=(b);i++)
#define F(i, a, b)      for(int i=(a);i>=(b);i--)
#define pi              acos(-1.0)
#define eps             1e-6
#define mem(a, b)       memset(a, b, sizeof(a))
#define mod             1000000007
#define inf             1e9
const int MX = 100005;
int f[MX], a[MX];
int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    //ios_base::sync_with_stdio(false); cin.tie(NULL);
    int n;
    cin>>n;
    f(i, 1, n)
    {
        cin>>a[i];
        f[a[i]]++;
    }
    int maxi = f[0]+f[1];
    f(i, 1, 100001)
    {
        maxi = max(maxi, f[i-1]+f[i]+f[i+1]);
    }
    cout << maxi << "\n";
    return 0;
}



Measured memory_bytes: 1024
#include <stdio.h>
int main(void){
    int N, X;
    int m;
    int i;
    int min = 0xFFFF;
    int res = 0;
    scanf("%d %d", &N, &X);
    for (i = 0; i < N; ++i) {
        scanf("%d", &m);
        X -= m;
        if (m < min) min = m;
        res++;
    }
    if(X > 0) res += X / min;
    printf("%d\n", res);
    return 0;
}


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

int main(){
    int N; cin >> N;
    vector <ll> A(N);
    rep(i,N) cin >> A[i];
    sort(A.begin(),A.end());
    
    rep(i,N-1){
        if (A[i]==A[i+1]){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}

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

int main() {
	int n;
	cin >> n;
	vector<int>l;
	int a;
	int count = 1;
	cin >> a; 
	int old_a = a;
	for (int i = 1; i < n; i++) {
		cin >> a;
		if (old_a == a) {
			count++;
		}
		else {
			l.push_back(count);
			count = 1;
		}
		old_a = a;
		if (i == n - 1) {
			l.push_back(count);
		}
	}
	int ans = 0;
	for (int i = 0; i < l.size(); i++) {
		ans += l[i] / 2;
	}
	cout << ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;



int main(){
  int a, b;
  char op;
  cin >> a >> op >> b;
  if(op == '+') cout << a+b << endl;
  else cout << a-b << endl;
  return 0;
}


Measured memory_bytes: 3532
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
cn = 0

for i in range(N):
    
    if B[i] <= A[i]:
        
        cn = cn + B[i]
    elif B[i] > A[i] and B[i] < (A[i]+A[i+1]) :
        cn = cn + B[i]
        A[i+1] = A[i+1] - (B[i] - A[i])
    elif B[i] >= A[i] + A[i+1]:
        cn = cn + A[i] + A[i+1]
        A[i] = 0
        A[i+1] = 0
        
      
print(cn)

Measured memory_bytes: 97644
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
signed main(){
  int N;
  cin>>N;
  vi A(N),B(N);
  rep(i,0,N){
    cin>>A[i];
    B[i]=A[i];
  }
  sort(ALL(B));
  double X=(B[N/2]+B[N/2-1])/2.0;
  rep(i,0,N){
    if(A[i]<=X) cout<<B[N/2]<<endl;
    else cout<<B[N/2-1]<<endl;
  }
}

Measured memory_bytes: 5376
// author -> LetsGoAC
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using    namespace std;
using    namespace __gnu_pbds; 
#define  ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
//  ordered_set<int> os;
//  order_of_key (k) : Number of items strictly smaller than k .
//  *find_by_order(k) : K-th element in a set (counting from zero).
typedef  long double ld;
#define  int long long
typedef  pair<int,int> pii;
#define  RAGE ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define  rep(i,n) for(i=0; i <n; i++)
#define  repv(i,k,n) for(int i=k; i<=n; i++)
#define  pb push_back
#define  mp make_pair
#define  F  first
#define  S  second
#define  sz(x)  (int)x.size()
#define  all(v) v.begin(),v.end()
#define  endl '\n'
#define  deb(x) cout<<#x<<" = "<<x<<endl
#define  gcd   __gcd
#define  inf   LLONG_MAX
#define  minf  LLONG_MIN 
#define  gi  greater<int> 
#define  gpi greater<pii>  
#define  sp(n) fixed<<setprecision(n)
vector   <int> Fact(100005 , 0);
const int mod = (int)(1e9+7);
int power(int x,int n)
{   
    if(n==0)    return 1;
    if(n==1)    return x%mod;
    if(n%2==0)  {   int y = power(x,n/2)%mod;return (y*y)%mod;}
    if(n&1)     {   int y = power(x,n-1);return (x%mod * y%mod)%mod;}
    return 0;
}
int mod_inverse(int n , int m)
{   //mod = m; // change const mod;
    int modi = power(n , m-2);
    return modi;
}
int  pct(int x)
{    return __builtin_popcountll(x);}
int  lcm(int a,int b){return a*b/gcd(a,b);}
bool is_power_2(int n){ return log2(n)==floor(log2(n));}
bool is_prime(int n){if(n<=1)return 0;for(int i=2; i*i<=n; i++)if(n%i==0)return 0; return 1;}
void cal_fac()
{
     Fact[0] = Fact[1] = 1;
     for(int i=2; i<100000; i++)
         Fact[i] = (Fact[i-1]*i)%mod;
}
int C(int n , int k)
{
    int res = Fact[n];
    res = (res * mod_inverse( Fact[k] , mod ))%mod;
    res = (res * mod_inverse( Fact[n-k] ,mod ))%mod;
    return res;
}
void db()
{       
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}
void timeit()
{  
    #ifndef ONLINE_JUDGE
        cout<<"\nTime Elapsed: " <<sp(10)<< 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
}
int     dx []    =  {-1 , 0 , 1 , 0 ,-1,-1, 1,  1};
int     dy []    =  { 0 , 1 , 0 ,-1 ,-1, 1, 1, -1};
char    dir[]    =  {'U','R','D','L'};
/* ---------------------- ar.cpp --------------------------------- */
const int maxn = 1e6+5;
void solve(int tc)
{
    //  cout<<"Case #"<<tc<<": ";
    int n,i,j,k,m,q,l,r;
    cin>>n;
    int ar[n];
    rep(i,n)
        cin>>ar[i];
    int suf[n+1];
    suf[n] = 0;
    for(i=n-1; i>=0; i--)
    {
        suf[i] = (suf[i+1]%mod + ar[i])%mod;
    }
    int ans =0 ;
    rep(i,n)
    {
        ans = ( ans%mod + (ar[i] * suf[i+1])%mod)%mod;
    }
    cout<<ans;
}
signed main()
{
    // ar.cpp
    RAGE;
  //  db();    
    int t=1;
    //  cin>>t;
    for(int i=1; i<=t; i++)
    {
        solve(i);
    }
 //   timeit();
    return 0;
}
/*
    1. To find 2's complement , reverse all the bits after 1st set bit. (right - >left.)
*/



Measured memory_bytes: 7168
#include<bits/stdc++.h>
using namespace std;
#define w(t) int t;cin>>t;while(t--)
#define pb   push_back
#define mk   make_pair
typedef long long ll;
const ll mod=1e9+7;
int solve(vector<int>A,int n){
	vector<ll>dp(n+1);
	dp[1]=0;
	for(int i=2;i<=n;i++){
		ll way1=abs(A[i]-A[i-1])+dp[i-1];
		ll way2;
		if(i!=2)
		way2=abs(A[i]-A[i-2])+dp[i-2];
		else
		 way2=INT_MAX;
		dp[i]=min(way1,way2);
	}
	return int(dp[n]%mod);
}
int main()
{

	ios_base::sync_with_stdio(false); 
	cin.tie(nullptr); 
	cout.tie(nullptr);
    int n;cin>>n;
    vector<int>A(n+1);
    for(int i=1;i<=n;i++)cin>>A[i];
    cout<<solve(A,n);

   
    return 0;
  
}

Measured memory_bytes: 1792
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int a = sc.nextInt();
  int b = sc.nextInt();
  int c = sc.nextInt();
  int d = sc.nextInt();
  if(Math.abs(a-c) <= d){
    System.out.println("Yes");
  }
  else if(Math.abs(a-b) <= d && Math.abs(b-c) <= d){
      System.out.println("Yes");
  }
  else{
  System.out.println("No");
  }
}}
    

Measured memory_bytes: 21844
a = input()
aList = []
for i in range(1,int(a)+1):
    if i%3 == 0 and i%5 == 0:
        pass
        # print('FizzBuzz')
    elif i%3 == 0:
        pass
        # print('Fizz')
    elif i%5 == 0:
        pass
        # print('Buzz')
    else:
        aList.append(i)
        # print(i)
ans = 0
for _,b in enumerate(aList):
    ans = ans + b
print(ans)


Measured memory_bytes: 30172
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()

int main(){
  ll n;
  cin >> n;
  if(n%2==0){
    cout << n / 2 << endl;
  }
  else{
    cout << n / 2 + 1 << endl;
  }
}

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

public class Main{
	final static int INF=(int)1e9;
	static int[][]memo;
	static char[][]grid;
	 static int x;
	 static int y;
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		 x=sc.nextInt();
		 y=sc.nextInt();
		memo=new int[x+1][y+1];
		grid =new char[x+1][y+1];
		
		for(int i=0;i<x;i++) {
			Arrays.fill(memo[i], -1);
			grid[i]=sc.next().toCharArray();
		}
		System.out.println(dp(0,0));
		
	}
	public static int dp(int i, int j) {
		
		if(x-1==i && j==y-1)
			return 1;
		
		if(i>=x||i==-1||j==-1||j>=y||grid[i][j]=='#')
			return 0;
		
		if(memo[i][j]!=-1) 
			return memo[i][j];
		
		int right=dp(i+1,j)%1000000007;
		
		int down=dp(i,j+1)%1000000007;

		return memo[i][j]=(right+down)%1000000007;
		
	}
	
	
	
}


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

int main() {
  int K,A,B;
  cin >> K >>A>>B;
  if (B-A>=K) {cout<< "OK" <<endl;}
  else if (A==B && A%K==0) {cout<< "OK" <<endl;}
  else if (A%K > B%K || A%K == 0) {cout<< "OK" <<endl;}
  else {cout<< "NG" <<endl;}
}


Measured memory_bytes: 3636
def main():
    import sys
    input = sys.stdin.readline
    
    a,b = map(int,input().split())

    #gcd(a,b)の素因数分解
    import math
    gcd = math.gcd(a,b)

    p = []
    for i in range(2,int(math.sqrt(gcd))+1):
        while gcd % i == 0:
            gcd /= i
            p.append(i)
            
    p.append(int(gcd))
    p.append(1)
    print(len(list(set(p))))

if __name__=='__main__':
    main()

Measured memory_bytes: 9216
N, M, C  = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(N)]

ans = 0

for i in range(N):
  D = 0
  for j in range(M):
    D += A[i][j] * B[j]
  D += C
  if D > 0:
    ans += 1

print(ans)

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

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

int par[55];

int root(int x){
	if(x==par[x])return x;
	return par[x]=root(par[x]);
}

void unite(int x,int y){
	x=root(x);
	y=root(y);
	par[x]=y;
}

int main(){
	int n,m;
	cin>>n>>m;
	vector<int>a(m),b(m);
	for(int i=0;i<m;i++){
		cin>>a[i]>>b[i];
		a[i]--,b[i]--;
			
	}
	int ret=0;
	for(int i=0;i<m;i++){
		for(int j=0;j<n;j++)par[j]=j;
		for(int j=0;j<m;j++){
			if(i!=j)unite(a[j],b[j]);
		}
		bool f=false;
		for(int j=1;j<n;j++){
			if(root(j-1)!=root(j))f=true;
		}
		if(f)ret++;
	}
	cout<<ret<<endl;
	return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)

	n := getNextInt(scanner)
	hh := make([]int, n)
	aa := make([]int64, n)
	for i := 0; i < n; i++ {
		hh[i] = getNextInt(scanner)
	}

	for i := 0; i < n; i++ {
		aa[i] = getNextInt64(scanner)
	}

	seg := Segment{}

	seg.init(n + 1)

	for i := 0; i < n; i++ {
		mx := seg.max(0, hh[i])
		seg.maximize(hh[i], mx+aa[i])
	}

	fmt.Fprintln(writer, seg.bucket[seg.h-1][0])
	writer.Flush()
}

// Segment ...
type Segment struct {
	n, h, i, chunk int
	unit           []int
	bucket         [][]int64
}

func (seg *Segment) init(n int) {
	seg.n = n
	seg.unit = make([]int, 1)
	seg.unit[0] = 1
	seg.bucket = make([][]int64, 1)
	seg.bucket[0] = make([]int64, n)

	chunk := 8
	for i := 0; n > 1; i++ {
		n = (n-1)/chunk + 1
		seg.bucket = append(seg.bucket, make([]int64, n))
		seg.unit = append(seg.unit, seg.unit[i]*chunk)
	}
	seg.h = len(seg.unit)
	seg.chunk = chunk
}

func (seg *Segment) maximize(index int, value int64) {
	seg.bucket[0][index] = value
	for seg.i = 0; seg.i < seg.h-1; seg.i++ {
		parent := index / seg.chunk
		if seg.bucket[seg.i+1][parent] < value {
			seg.bucket[seg.i+1][parent] = value
		}
		index /= seg.chunk
	}
}

func (seg *Segment) max(l, r int) int64 {
	var max int64
	if seg.n < r {
		r = seg.n
	}
	var i int
	for index := l; index < r; index += seg.unit[i] {
		for i < seg.h-1 && index%seg.unit[i+1] == 0 {
			i++
		}
		for i > 0 && index+seg.unit[i] >= r {
			i--
		}
		ii := index / seg.unit[i]
		if max < seg.bucket[i][ii] {
			max = seg.bucket[i][ii]
		}
	}

	return max
}


Measured memory_bytes: 11628
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

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

typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

int main() {
	LL n, p, ans = 0, x;
	cin >> n >> p;

	if (n == 1)ans = p;
	else{
		if (n == 2)x = pow(p, 0.5);
		if (n >= 3)x = pow(p, 0.4);
		FOR(i, 1, x+1) {
			if (p % (LL)pow(i, n) == 0) {
				if (ans < i)ans = i;
			}
		}
	}
	cout << ans << endl;
}

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

char checkGroup(int a){
    switch(a){
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            return 'a';
            break;
        case 4:
        case 6:
        case 9:
        case 11:
            return 'b';
            break;
        default:
            return 'c';
            break;
    }
}

int main(void){
    int x,y; cin >> x >> y;
    if(checkGroup(x)==checkGroup(y)) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define endl            "\n"
#define forn(i,x1,n)     for(int i=x1; i<n; i++)
#define forit(it, m)    for(decltype(m)::iterator it = m.begin(); it!=m.end(); ++it)
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x1)      __builtin_popcountll(x1)
#define zrobits(x1)      __builtin_ctzll(x1)
#define mod             1000000007
#define inf             1e18
#define ps(x1,y)         fixed<<setprecision(y)<<x1
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x1)            int x1; cin>>x1; while(x1--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());


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

int32_t main() {

    zeus();

    int n, x, t; cin >> n >> x >> t;

    cout << (int)ceil((n * 1.0) / x)*t << endl;




}








Measured memory_bytes: 3640
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;

const int mod = 1e9 + 7;

int main() {
	int n, m; cin >> n >> m;
	vector<ll>x(n), y(m); for (auto&& xx : x)cin >> xx;for (auto&& yy : y)cin >> yy;
	sort(x.begin(), x.end());sort(y.begin(), y.end());
	ll a = 0, b = 0;
	for (int i = 0; i < n; i++)a -= x[i] * (n - 1 - i - i);
	for (int i = 0; i < m; i++)b -= y[i] * (m - 1 - i - i);
	cout << (a % mod) * (b % mod) % mod << endl;
	return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<set>
#include<algorithm>
#include<utility>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1001001001;

ll pow_mod(ll p, ll n, ll m) {
	if (n == 0) return 1;
	else if (n == 1) return p % m;
	else if (n % 2 == 1) return p * pow_mod(p, n - 1, m) % m;
	else {
		ll tmp = pow_mod(p, n / 2, m);
		return (tmp * tmp) % m;
	}
}

ll gcd(ll x, ll y) {
	if (y == 0) {
		return x;
	}
	return gcd(y, x % y);
}

ll com_mod(ll n, ll k, ll m) {
	if (k == 0) return 1;
	else {
		ll x = 1;
		ll y = 1;
		for (ll i = 0; i < k; i++) {
			x = (x * (n - i)) % m;
			y = (y * (i + 1)) % m;
		}
		ll res = (x * pow_mod(y, m - 2, m)) % m;
		return res;
	}
}

int main() {
	int n, a, b;
	cin >> n >> a >> b;
	ll ans = pow_mod(2, n, mod) - 1;
	ans = (ans + mod) % mod;
	ans -= com_mod(n, a, mod);
	ans = (ans + mod) % mod;
	ans -= com_mod(n, b, mod);
	ans = (ans + mod) % mod;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3540
from bisect import bisect_left

n,ans=int(input()),0
S=list(map(int,input().split()))
q=int(input())
T=list(map(int,input().split()))

for t in T:
  index = bisect_left(S,t)
  if t == S[index]:
    ans += 1
    
print(ans)


Measured memory_bytes: 16744
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

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

#define INF 1000000000

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);

    REP(i, n)
    cin >> a[i];

    sort(ALL(a));

    int N = a[n - 1];
    double nn = N / 2.0;
    double diff = nn;

    int R = a[0];

    REP(i, n - 1) {
        if (fabs(nn - a[i]) < diff) {
            diff = fabs(nn - a[i]);
            R = a[i];
        }
    }

    cout << N << " " << R << endl;

    return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
int main() {
  double v, y;
  unsigned long long int n;
  while (scanf("%lf", &v) != EOF) {
    y = v / 19.6 * v;
    if (y - y / 5) n = (int) (y / 5) + 2;
    else n = (int) (y / 5) + 1;
    printf("%llu\n", n);
  }
  return 0;
}

Measured memory_bytes: 632
// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);
//auto start=high_resolution_clock::now();
//auto end=high_resolution_clock::now();
// cout<<duration_cast<milliseconds>(end-start).count()<<endl;
// variable type var=numeric_limits<variable type>::max()/min();
//#define _GLIBCXX_DEBUG//only for debugging
/*BISMILLAH UR RAHMAN*/ 
/* AUTHOR -CARLOSRAMIREZ *///Perfection is achieved only on the point of collapse
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout<<fixed<<setprecision(10);
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define debug(x) std::cerr << #x << ": " << (x) << '\n';
#define sz(x) int(x.size())
#define INF INT_MAX;
using namespace std;
using namespace std::chrono;
typedef long long int ll;
ll arr[int(1e5+10)];
ll store[int(1e5+10)];
ll dp(int n)
{
  if(n<=0)return LLONG_MAX;
  if(store[n]!=-1)return store[n];
  ll ans;
  ans=min(abs(arr[n]-arr[n-1])+dp(n-1),abs(arr[n]-arr[n-2])+dp(n-2));
  return store[n]=ans;
}
int main()
{
  fast
  memset(store,-1,sizeof(store));
  int n;cin>>n;
  for(int i=1;i<=n;++i)
    cin>>arr[i];
    store[1]=0ll;
    store[2]=ll(abs(arr[2]-arr[1]));
    cout<<dp(n);

}
   

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

int main()
{
  int n;
  cin >> n;
  
  for(int i = 1; i <= 9; i++){
    for(int j = 1; j <= 9; j++){
      if(i * j == n){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  
   cout << "No" << endl;
}

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

//短縮
#define rep(i,n) for(int i=0;i<(n);++i)
//sort()用
#define all(v) v.begin(), v.end()

using namespace std;

int main(){
  string S,T;
  cin >>  S >> T;
  int flag=0;
  rep(i,S.size()){
    if(S.at(i)!=T.at(i))flag = 1;
  }
  if(flag)cout << "No";
  else cout << "Yes";
  return 0;
}


Measured memory_bytes: 3624
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.NoSuchElementException;

public class Main {
	int n;
	long mo = 1_000_000_000 + 7;
	long[] fac = new long[3000000];
	long[] ifac = new long[3000000];
	long[] inv = new long[3000000];
	{
		fac[0] = 1;
		for (int i = 1; i < fac.length; ++i) {
			fac[i] = i * fac[i - 1] % mo;
		}
		inv[1] = 1;
		for (int i = 2; i < inv.length; ++i) {
			inv[i] = mo - inv[(int) (mo % i)] * (mo / i) % mo;
		}
		ifac[0] = 1;
		for (int i = 1; i < ifac.length; ++i) {
			ifac[i] = ifac[i - 1] * inv[i] % mo;
		}
	}

	long comb(int n, int k) {
		return fac[n] * ifac[n - k] % mo * ifac[k] % mo;
	}

	long g(int k) {
		if (2 * k < n)
			return 0;
		int a = 2 * k - n;
		int b = n - k;
		return comb(a - 1 + b, b - 1) * fac[k] % mo * fac[n - 1 - k] % mo;
	}

	long f(int k) {
		return (g(k) - g(k - 1) + mo) % mo;
	}

	void run() {
		Scanner sc = new Scanner();
		n = (int) sc.nextLong();
		long ans = 0;
		for (int i = (n + 1) / 2; i <= n - 1; ++i) {
			ans = (ans + f(i) * i % mo) % mo;
		}
		System.out.println(ans);
	}

	long pow(long a, long n) {
		long ret = 1;
		for (; n > 0; n >>= 1, a = a * a % mo) {
			if (n % 2 == 1) {
				ret = ret * a % mo;
			}
		}
		return ret;
	}

	long inv(long a) {
		return pow(a, mo - 2);
	}

	public static void main(String[] args) {
		new Main().run();
	}

	class Scanner {
		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 boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private void skipUnprintable() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr]))
				ptr++;
		}

		public boolean hasNext() {
			skipUnprintable();
			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();
			}
		}
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}


Measured memory_bytes: 93652
#include<iostream>
#include<algorithm>
using namespace std;
long long a[1000000];
signed main(){
  while(1){
    long long n,b,c,d,max;
    b=0;
    cin>>n;
    if(n==0) break;  
    d=n;
    for(int i=0;i<n;i++){
      cin>>c;
      b=b+c;
    }
    max=d*b;
    for(int i=0;i<n-1;i++){
      cin>>a[i];
    }
    sort(a,a+n-1,greater<long long>());
    for(int i=0;i<n-1;i++){
      b=b+a[i];
      d--;
      if(max<b*d){
	max=b*d;
      }
      else{
	break;
      }
    }
    cout<<max<<"\n";
  }
  return(0);
}



Measured memory_bytes: 3672