akhauriyash/Code-Regression huggingface dataset:
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 100_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "a", long, "b");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    auto n = lread();
    bool check = true;
    long pre_t, pre_x, pre_y;
    foreach (_; iota(n))
    {
        long t, x, y;
        scan(t, x, y);
        long dist = abs(x - pre_x) + abs(y - pre_y);
        if (t - pre_t < dist)
            check = false;
        if ((dist - (t - pre_t)) % 2)
            check = false;

        pre_t = t;
        pre_x = x;
        pre_y = y;
    }
    if (check)
        writeln("Yes");
    else
        writeln("No");
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}


Measured memory_bytes: 3684
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#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(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100 * 3

int k,t;

int main() {
	cin >> k >> t;
	int MAX = 0;
	rep(i, t) {
		int a;
		cin >> a;
		MAX = max(MAX, a);
	}
	if (t == 1)cout << k - 1 << endl;
	else cout << max(0, MAX - 1 - (k - MAX)) << endl;
}

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

int main(){
    int n;
    cin>>n;
    vector<ll>a(100005);
    ll moto=0;
    rep(i,n){
        int temp;
        cin>>temp;
        a[temp]++;
        moto+=temp;
    }
    int q;
    cin>>q;
    vector<ll>ans;
    rep(i,q){
        int b,c;
        cin>>b>>c;
        int sa=c-b;
        moto+=sa*a[b];
        a[c]+=a[b];
        a[b]=0;
        ans.push_back(moto);
    }
    rep(i,ans.size())cout<<ans[i]<<endl;
}

Measured memory_bytes: 5096
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
    int abc[26] = {0};

    string w;
    cin >> w;

    REP(i, w.size()){
        abc[w[i] - 'a']++;
    }

    bool flag = true;

    REP(i, 26){
        if (abc[i] % 2 == 1) flag = false;
    }

    if (flag == true) cout << "Yes" << endl;
    else cout << "No" << endl;



}

Measured memory_bytes: 256
n = gets.to_i
a = gets.split.map(&:to_i)
while a.uniq.count != 1
  a.sort!
  for i in 1..(a.count - 1)
    dmg = (a[i] / a[0]) * a[0]
    a[i] -= dmg
  end
  a.delete(0)
  a.uniq!
end
puts a[0]

Measured memory_bytes: 15748
#include<stdio.h>
int main(){
  long long n,i,j;
  scanf("%lld",&n);
  if(n%2==0)printf("%lld %lld %lld\n",n,n,n/2);
  else{
    for(i=1;i<3501;i++){
      for(j=i;j<3501;j++){
	if(4*i*j<=n*i+n*j)continue;
	if((n*i*j)%(4*i*j-n*i-n*j)==0){
	  printf("%lld %lld %lld\n",i,j,(n*i*j)/(4*i*j-n*i-n*j));
	  return 0;
	}
      }
    }
  }
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
using namespace std;

int main(){
    int l, n;
    cin >> n >> l;

    string s[n];
    for(int i=0;i<n;i++)cin >> s[i];

    sort(s, s+n);
    for(int i=1;i<n;i++)s[0] += s[i];

    cout << s[0] << endl;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <unordered_map>
//#include"testlib.h"
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define watch(x) cout << (#x)<<" = "<<x<<endl
#define sz(s)    (int)(s.size())
#define PI acos(-1)
#define EPS 1e-100
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("street.in", "r", stdin);
	//freopen("out.txt", "w", stdout);
#endif
}
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}
const int N = 1e5 + 9;
vi adjL[N];
int main() {
//	file();
	fast();
	int n, m; cin >> n >> m;
	vi hi(n);
	for (auto& it : hi)
		cin >> it;
	while (m--) {
		int u, v; cin >> u >> v;
		u--, v--;
		adjL[u].push_back(v);
		adjL[v].push_back(u);
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int mx = 0;
		for (auto& it : adjL[i])
			mx = max(mx, hi[it]);
		if (hi[i] > mx)
			ans++;
	}
	cout << ans << endl;
	return 0;
}


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

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n, m, q; cin >> n >> m >> q;
    set<int> s;
    for(int i = 0; i < n; ++i) s.insert(i);
    auto now = begin(s);
    auto pass = [&] (auto it, bool rev) {
        if(rev) {
            if(it == begin(s)) return prev(end(s));
            else               return prev(it);
        } else {
            auto res = next(it);
            return (res == end(s) ? begin(s) : res);
        }
    };
    for(int i = 0; i < m; ++i) {
        int a; cin >> a;
        const bool pre = a & 1;
        while(a--) {
            now = pass(now, pre);
        }
        auto nxt = pass(now, false);
        s.erase(now);
        now = nxt;
    }
    for(int i = 0; i < q; ++i) {
        int x; cin >> x;
        cout << s.count(x) << endl;
    }
}



Measured memory_bytes: 12476
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>

//AOJ0072
#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;
struct ttk{
	int tf,tt,km;
//	ttk(int tf, int tt, int km): tf(tf), tt(tt), km(km) {}
	bool operator<(const  ttk  &s) const {
    return km < s.km;
  }

};

int main(void){

int n,m;
char k;
	while(cin >> n){
		if(n==0 || cin.eof()) break;
		vector<int> mt(n,0);
		int cnt=0,cnt2=0;
		cin >> m;
		vector< ttk > tw(m);
		rep(i,m)
			cin >> tw[i].tf >> k >> tw[i].tt >> k >> tw[i].km;
		sort(tw.begin(), tw.end());
//		rep(i,m) printf("%d-%d :%d\n",tw[i].tf, tw[i].tt, tw[i].km );
		mt[tw[0].tf]=1; 	mt[tw[0].tt]=1;
		cnt += 1;    cnt2 += tw[0].km;
		
		while(1){
			bool brsw=true;
			rep(i,m){
				if(mt[tw[i].tf] + mt[tw[i].tt] == 1){
					mt[tw[i].tf]=1; 	mt[tw[i].tt]=1;
					cnt += 1;    cnt2 += tw[i].km;
					break;
				}
			}
			rep(i,n) if(mt[i]==0) brsw = false;
			if(brsw) break;
			
			
		}

//		printf(" %d: %d \n",cnt,cnt2);
		cout << cnt2/100 - cnt << endl;
	}
	return 0;
	
}

Measured memory_bytes: 1272
#include <iostream>  // cin,cout
#include <stdio.h>   // printf,scanf (standard input/output)
#include <cmath>     // abs(x),pow(x,2)
#include <string>
#include <string.h>  // strlen, strcmp
#include <algorithm> // min,max, sort(v.begin(),v.end())
#include <vector>
#include <time.h>
using namespace std;

struct Data{
    int A;
    string S;
    
    bool operator<( const Data& right ) const {
        return A == right.A ? S < right.S : A < right.A;
        //return A < right.A;
    }
};

int Func(){
    int x = 0;
    return x;
}

int main(){
    
    int A,B;
    
    // 入力
    cin >> A >> B;
    
    if (A*B==2) {
        cout << 3 << endl;
    }
    else if (A*B==3) {
        cout << 2 << endl;
    }
    else {
        cout << 1 << endl;
    }
    
    
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int main(){
	int ta[10],v1,v2;
	char xx;
	while(true){
	int sum=0;
	for(int i=0;i<10;i++){cin>>ta[i]>>xx;sum+=ta[i];}
	if(!(cin>>v1>>xx>>v2))break;
	double t=0.0;
	for(;;t+=0.001){
		if(v1*t+v2*t>=sum)break;
	}
	int ans=0;double tsum=0.0;
	for(int i=0;i<10;i++){
		if(tsum>v1*t)break;
	if(t*v1-tsum<=0.00001){break;}
	tsum+=ta[i];
	ans++;
	}
		cout<<ans<<endl;
	}

	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	while(1){
		int n, m; cin >> n >> m;
		if(!n && !m) break;
		vector<pair<int, int> > dp(n);
		for(int i=0; i<n; i++) cin >> dp[i].first >> dp[i].second;
		sort(dp.begin(), dp.end(), [](auto l, auto r){
			return l.second > r.second;
			});
		int ans = 0;
		for(int i=0; i<n; i++){
			if(dp[i].first <= m) m -= dp[i].first;
			else{
				ans += (dp[i].first-m) * dp[i].second;
				m = max(0, m-dp[i].first);
			}
		}
		cout << ans << endl;
	}
}


Measured memory_bytes: 3084
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;

int main() {
	int x, y;
	while (1) {
		cin >> x >> y;
		if (x == 0 && y == 0) {
			break;
		}
		if (x > y) {
			cout << y << " " << x << endl;
		}
		else {
			cout << x << " " << y << endl;
		}
	}
}


Measured memory_bytes: 3132
#include<stdio.h>

int main(){
	int N,M,X,Y,i,Xmax=-100,Ymin=100;
	scanf("%d %d %d %d",&N,&M,&X,&Y);
	int x[N+1],y[M+1];
	for(i=1;i<=N;i++) scanf("%d",&x[i]);
	for(i=1;i<=M;i++) scanf("%d",&y[i]);
	
	for(i=1;i<=N;i++){
		if(Xmax<x[i]) Xmax=x[i];
	}
	for(i=1;i<=M;i++){
		if(Ymin>y[i]) Ymin=y[i];
	}
	
	if(Xmax>=Ymin){
		printf("War");
		return 0;
	}
	else{
		for(i=Xmax+1;i<=Ymin;i++){
			if(X<i&&i<=Y){
				printf("No War");
				return 0;
			}
		}
		printf("War");
	}
}


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

#ifdef LOCAL
#include "../dump.hpp"
#else
#define dump(...)
#endif

#define rep(i,n) for(ll i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(ll i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(ll i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
#define SUM(a) accumulate(all(a),0)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair

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

const ll inf = 1ll<<62;
const ll mod = 1e9+7;

int main(){
#define int ll
  map<string,function<string(string,string)>> op;
  auto add = [](string s, string t){
    return to_string(stoi(s) + stoi(t));
  };
  op["+"] = add;
  auto mul = [](string s, string t){
    return to_string(stoi(s) * stoi(t));
  };
  op["*"] = mul;

  map<string,string> e;
  e["+"] = "0";
  e["*"] = "1";
  
  while(1){
    int n; cin >> n; if(n == 0) break;

    vs in(n);
    vi level(n);
    int maxlevel = -1;
    rep(i,n){
      cin >> in[i];
      level[i] = sz(in[i]) - 1;
      maxlevel = max(maxlevel, level[i]);
      in[i] = in[i][level[i]];
    }
    dump(in);
    ROF(k,maxlevel,0){
      /*
      cout << k << endl;
      cout << sz(in) << endl;
      cout << sz(level) << endl;
      */
      ROF(i,sz(in),0){
	if(level[i] == k and op.count(in[i]) == 1){
	  string ope = in[i];
	  in[i] = e[in[i]];
	  int j = i+1;
	  while(1){
	    if(j == sz(in) or level[j] != k+1) break;
	    in[i] = op[ope](in[i], in[j]);
	    in.erase(in.begin() + j);
	    level.erase(level.begin() + j);
	  }
	  dump(in);
	}
      }
    }
    cout << in[0] << endl;
  }
}


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

char map[20][20];
int visited[20][20];

void dfs(int x, int y, int w, int h) {
    visited[x][y] = 1;
    for (int i = -1; i <= 1; i += 2) {
        if (0 <= x+i && x+i < h && visited[x+i][y] == 0 && map[x+i][y] == '.')
            dfs(x+i, y, w, h);
    }
    for (int i = -1; i <= 1; i += 2) {
        if (0 <= y+i && y+i < w && visited[x][y+i] == 0 && map[x][y+i] == '.')
            dfs(x, y+i, w, h);
    }
}

int main(int argc, char *argv[])
{
    int w, h, x, y, sum;
    string line;
    while (cin >> w >> h, w | h) {
        for (int i = 0; i < 20; ++i)
            for (int j = 0; j < 20; ++j)
                visited[i][j] = 0;
        for (int i = 0; i < h; ++i) {
            cin >> line;
            for (int j = 0; j < w; ++j) {
                map[i][j] = line[j];
                if (line[j] == '@') {
                    x = i;
                    y = j;
                }
            }
        }
        dfs(x, y, w, h);
        sum = 0;
        for (int i = 0; i < 20; ++i)
            for (int j = 0; j < 20; ++j)
                sum += visited[i][j];
        cout << sum << endl;
    }
    return 0;
}

Measured memory_bytes: 1212
#include<stdio.h>
#include<string.h>
int main(){
	int a;
	scanf("%s", &a);
	char str(255);
	if(a>='A' && a<='Z'){
		printf("A\n");
	}
	else if (a>='a' && a<='z'){
		printf("a\n");
	}
	return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
typedef long long ll;
typedef long double ld;
using namespace std;

const int N = 100010;
ll a[N];
int n, m;

int main() {

  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", a + i);
  }
  sort(a + 1, a + 1 + n);
  vector<pair<int, int>> v(m); // {c, b}
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &v[i].s, &v[i].f);
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());

  for (int j = 0, i = 1; j < m; j++) {
    if (i > n) break;
    if (v[j].f <= a[i]) break;
    int p = 0;
    while (i <= n && p < v[j].s && a[i] < v[j].f) {
      a[i] = v[j].f;
      i++;
      p++;
    }
  }

  printf("%lld\n", accumulate(a + 1, a + 1 + n, 0ll));

  return 0;
}

Measured memory_bytes: 1920
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	h, w, k := scanInt(), scanInt(), scanInt()
	x1, y1, x2, y2 := scanInt()-1, scanInt()-1, scanInt()-1, scanInt()-1
	c := make([]string, h)
	d := make([][][4]int, h)

	for i := 0; i < h; i++ {
		c[i] = scanString()
		d[i] = make([][4]int, w)
		for j := 0; j < w; j++ {
			for l := 0; l < 4; l++ {
				d[i][j][l] = inf
			}
		}
	}
	for i := 0; i < 4; i++ {
		d[x1][y1][i] = 0
	}

	pq := &pqAsc{pair{x1, y1, 0, 0}}
	heap.Init(pq)
	dx, dy := []int{0, -1, 0, 1}, []int{1, 0, -1, 0}

	for len(*pq) != 0 {
		p := heap.Pop(pq).(pair)
		if p.co > d[p.x][p.y][p.d] {
			continue
		}

		if p.x == x2 && p.y == y2 {
			fmt.Fprintln(wr, (p.co+k-1)/k)
			return
		}

		for i := 0; i < 4; i++ {
			nx, ny := p.x+dx[i], p.y+dy[i]
			if nx < 0 || ny < 0 || nx >= h || ny >= w || c[nx][ny] == '@' {
				continue
			}
			var co int
			if p.d == i {
				co = p.co + 1
			} else {
				co = (p.co+k-1)/k*k + 1
			}
			if d[nx][ny][i] > co {
				d[nx][ny][i] = co
				heap.Push(pq, pair{nx, ny, i, co})
			}
		}
	}

	fmt.Fprintln(wr, -1)

}

type pair struct{ x, y, d, co int }

const inf = 1<<63 - 1

type pqAsc []pair

func (pq pqAsc) Len() int            { return len(pq) }
func (pq pqAsc) Swap(i, j int)       { pq[i], pq[j] = pq[j], pq[i] }
func (pq pqAsc) Less(i, j int) bool  { return pq[i].co < pq[j].co }
func (pq *pqAsc) Push(x interface{}) { *pq = append(*pq, x.(pair)) }
func (pq *pqAsc) Pop() interface{} {
	x := (*pq)[len(*pq)-1]
	*pq = (*pq)[0 : len(*pq)-1]
	return x
}


Measured memory_bytes: 93340
#include "iostream"

using namespace std;

int main() {

	short in[2000000];
	short ans[2000000];
	int co[10001];
	int n;

	cin >> n;

	for (int i = 0; i <= 10000; i++) {
		co[i] = 0;
	}

	for (int i = 0; i < n; i++) {
		cin >> in[i];
		co[in[i]]++;
	}

	co[0]--;
	for (int i = 1; i <= 10000; i++) {
		co[i] += co[i - 1];
	}
	for (int i = 0; i < n; i++) {
		ans[co[in[i]]] = in[i];
		co[in[i]]--;
	}

	for (int i = 0; i < n; i++) {
		cout << ans[i];
		if (i < n - 1) cout << " ";
	}

	cout << endl;

	return 0;
}

Measured memory_bytes: 9012
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int main(void)
{
  long n;

  cin >> n;
  /*
  vectr<int> a(n);
  for(int i = 0;i < n;i++)
    a[i] = i + 1;
  */
  cout << (n - 1) * n / 2 << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
 
int32_t main()
{
    int n; cin>>n;
    string s;
    cin>>s;
    int r=0,w=0,res,temp =0;
    for(int i=0;i<n;i++){
        
        if(s[i]=='W'){
            w++;
        }
        else{
            r++;
        }
    }
    for(int i=n-1;i>=n-w;i--){
        if(s[i] == 'W'){
            temp++;
        }
    }
    res = abs(w-temp);
    cout<<res;
    return 0;
}

Measured memory_bytes: 3748
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;



int main(){
  ios_base::sync_with_stdio(false);

  string s;
  cin >> s;
  for(int i=0;i<s.size()-8;i++){
    cout << s[i];
  }
  cout << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
using namespace std;

int main(void) {
  int N, M;
  cin >> N >> M;
  vector<int> A(N+1);
  priority_queue<int> queue;
  
  for(int i = 1; i <= N; i++) {
    cin >> A[i];
    queue.push(A[i]);
  }
  
  for(int i = 0; i < M; i++) {
    int n = queue.top();
    queue.pop();
    queue.push(n/2);
  }
  double sum = 0;
  for(int i = 0; i < N; i++) {
    sum += queue.top();
    queue.pop();
  }
  std::cout << std::fixed;
  std::cout << std::setprecision(0);
  cout << sum;
  return 0; 
}

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

public class P
{
    public string via { get; set; }
    public string via2 { get; set; }
}

public class hello
{
    public static void Main()
    {
        var d = new Dictionary<char, int>()
        { { 'R', 1 }, { 'r', -1 }, { 'G', 2 }, { 'g', -2 }, { 'B', 3 }, { 'b', -3 }, { 'W', 4 }, { 'w', -4 } };
        var n = int.Parse(Console.ReadLine().Trim());
        var z = 0;
        while (z++ < n)
        {
            var ps = new int[9, 4, 4];
            string[] line = Console.ReadLine().Trim().Split(' ');
            for (int i = 0; i < 9; i++)
            {
                var t = line[i];
                for (int j = 0; j < 4; j++) ps[i, 0, j] = d[t[j]];
            }
            getPs(ps);
            getAns(ps);
        }
    }
    static void getAns(int[,,] ps)
    {
        var ans = 0;
        var st = new Stack<P>();
        for (int i = 0; i < 9; i++)
            for (int j = 0; j < 4; j++)
                st.Push(new P { via = i.ToString(), via2 = j.ToString() });
        while (st.Count() > 0)
        {
            var w = st.Pop();
            if (w.via.Length == 9) { ans++; continue; }
            for (int i = 0; i < 9; i++)
                for (int j = 0; j < 4; j++)
                    if (!w.via.Contains(i.ToString()) && check(ps, w.via, w.via2, i, j))
                        st.Push(new P { via = w.via + i.ToString(), via2 = w.via2 + j.ToString() });
        }
        Console.WriteLine(ans);
    }
    static bool check(int[,,] ps, string via, string via2, int i, int j)
    {
        var vL = via.Length;
        if (vL == 1 | vL == 2)
        {
            var t = ps[via[vL - 1] - '0', via2[vL - 1] - '0', 1];
            return ps[i, j, 3] + t == 0;
        }
        else if (vL == 3)
        {
            var t = ps[via[0] - '0', via2[0] - '0', 2];
            return ps[i, j, 0] + t == 0;
        }
        else if (vL == 6)
        {
            var t = ps[via[3] - '0', via2[3] - '0', 2];
            return ps[i, j, 0] + t == 0;
        }
        else
        {
            var t = ps[via[vL - 3] - '0', via2[vL - 3] - '0', 2];
            var t2 = ps[via[vL - 1] - '0', via2[vL - 1] - '0', 1];
            return (ps[i, j, 0] + t == 0) && (ps[i, j, 3] + t2 == 0);
        }
    }
    static void getPs(int[,,] ps)
    {
        for (int i = 0; i < 9; i++)
        {
            ps[i, 1, 0] = ps[i, 0, 3];
            ps[i, 1, 1] = ps[i, 0, 0];
            ps[i, 1, 2] = ps[i, 0, 1];
            ps[i, 1, 3] = ps[i, 0, 2];

            ps[i, 2, 0] = ps[i, 0, 2];
            ps[i, 2, 1] = ps[i, 0, 3];
            ps[i, 2, 2] = ps[i, 0, 0];
            ps[i, 2, 3] = ps[i, 0, 1];

            ps[i, 3, 0] = ps[i, 0, 1];
            ps[i, 3, 1] = ps[i, 0, 2];
            ps[i, 3, 2] = ps[i, 0, 3];
            ps[i, 3, 3] = ps[i, 0, 0];
        }
    }
}


Measured memory_bytes: 20768
#include<iostream>
using namespace std;
#define MAX 100005
#define NIL -1

struct Node{int p,l,r;};

Node T[MAX];
int n, D[MAX];

void print(int u){
	int i,c;
	cout <<"node "<<u<<": ";
	cout <<"parent = "<<T[u].p<<", ";
	cout <<"depth = "<<D[u]<< ", ";
	
	if(T[u].p==NIL)cout<<"root, ";
	else if(T[u].l==NIL)cout<<"leaf, ";
	else cout<<"internal node, ";
	
	cout<<"[";

	for(i=0,c=T[u].l;c!=NIL;i++,c=T[c].r){
		if(i)cout<<", ";
		cout<<c;
	}
	cout<<"]"<<endl;
}


int rec(int u,int p){
	D[u]=p;
	if(T[u].r!= NIL)rec(T[u].r,p);
	if(T[u].l!= NIL)rec(T[u].l,p+1);
	return 0;
}

int main(){
	int i,j,d,v,c,l,r;
	cin>>n;
	for(i=0;i<n;i++)T[i].p=T[i].l=T[i].r=NIL;
	
	for(i=0;i<n;i++){
		cin>>v>>d;
		for(j=0;j<d;j++){
			cin>>c;
			if(j==0)T[v].l=c;
			else T[l].r=c;
			l=c;
			T[c].p=v;
		}
	}
	for(i=0;i<n;i++){
		if(T[i].p==NIL)r=i;
	}
	rec(r,0);
	
	for(i=0;i<n;i++)print(i);
	
	return 0;
}


Measured memory_bytes: 7700
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath> 
#include <queue>
#include <functional>

using namespace std;
//typedef long long ll;
//typedef pair<int, int> P;
//static const int dx[4] = {1, -1, 0, 0};
//static const int dy[4] = {0, 0, 1, -1};

//const ll MOD = 1e+9 + 7;
//const int MAX = 10001;

int main() {

    int L , R; cin >> L >> R;

    int mod = 2019;

    if (R - L >= mod) {
        cout << 0 << '\n';
        return 0;
    }

    vector<int> v;
    for (int i= L; i <= R; i++) {
        v.push_back(i % mod);
    }

    int ans = 2020;
    for (int i = 0; i < v.size(); i++) {
        for (int j = i+1; j < v.size(); j++) {
            ans = min(ans, v[i] * v[j] % mod);
        }
    }

    cout << ans << '\n';

}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll/*////////*/long long                           ///////////////////////////////
#define gcd(a,b)/*////////*/__gcd(a,b)                    //Please get-off from my code//
#define pi/*////////*/3.1415926536                        ///////////////////////////////
using namespace std;
int lcm(int a,int b){return (a*b)/(gcd(a,b));}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	//------Enter your code here.------
	int n;cin>>n;
	if(n>=400 and n<600)cout<<8;
	else if(n>=600 and n<800)cout<<7;
	else if(n>=800 and n<1000)cout<<6;
	else if(n>=1000 and n<1200)cout<<5;
	else if(n>=1200 and n<1400)cout<<4;
	else if(n>=1400 and n<1600)cout<<3;
	else if(n>=1600 and n<1800)cout<<2;
	else if(n>=1800 and n<2000)cout<<1;
}

Measured memory_bytes: 3644
#[allow(unused_imports)]
use std::cmp::{min,max};

fn main() {
    let (n,c) = {
        let xs = read_vec_i64();
        (xs[0] as usize,xs[1])
    };
    let xs = {
        let mut res = vec![];
        for _ in 0..n {
            let xs = read_vec_i64();
            res.push((xs[0],xs[1]));
        }
        res
    };
    let ys = {
        let mut res = vec![];
        let mut cal = 0;
        for i in 0..n {
            cal += xs[i].1;
            res.push(cal-xs[i].0);
        }
        res
    };
    let ys_max = {
        let mut res = vec![0; n];
        let mut m = 0;
        for i in 0..n {
            m = max(m, ys[i]);
            res[i] = m;
        }
        res
    };
    let zs = {
        let mut res = vec![0; n as usize];
        let mut cal = 0;
        for i in (0..n).rev() {
            cal += xs[i].1;
            res[i] = cal - (c-xs[i].0);
        }
        res
    };
    let zs_max = {
        let mut res = vec![0; n];
        let mut m = 0;
        for i in (0..n).rev() {
            m = max(m, zs[i]);
            res[i] = m;
        }
        res
    };
    let mut res = 0;
    for i in 0..n {
        let t = ys[i];
        res = max(res, t);
        if i+1 < n {
            let u = t - xs[i].0 + zs_max[i+1];
            res = max(res, u);
        }
    }
    for i in 0..n {
        let t = zs[i];
        res = max(res, t);
        if i >= 1 {
            let u = t - (c-xs[i].0) + ys_max[i-1];
            res = max(res, u);
        }
    }
    println!("{}", res);
}

#[allow(dead_code)]
fn read_line() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    ret.pop();
    return ret;
}

#[allow(dead_code)]
fn read_i64() -> i64 {
    let ss = read_line();
    return ss.parse::<i64>().unwrap();
}

#[allow(dead_code)]
fn read_vec_i64() -> Vec<i64> {
    let mut res = vec![];
    let ss = read_line();
    for ts in ss.split_whitespace() {
        let x = ts.parse::<i64>().unwrap();
        res.push(x);
    }
    return res;
}


Measured memory_bytes: 10492
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define L_T_S_K ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);  
const int mod = 1e9 + 7;
const int N = 89;
bool dp[N][N][N * N] ;
int mat1[100][100] , mat2[100][100];  
int32_t main(){
 L_T_S_K;
 int h , w;
 cin >> h >> w;
 for(int i = 0 ; i < h ;i++){
  for(int j = 0 ; j < w ;j++){
    cin >> mat1[i][j];
  }
 }
 for(int i = 0 ; i < h ;i++){
  for(int j = 0 ; j < w ;j++){
    cin >> mat2[i][j];
  }
 }
 dp[0][0][abs(mat1[0][0] - mat2[0][0])] = true;
 for(int i = 0 ; i < h ;i++){
  for(int j = 0 ; j < w ; j++){
    for(int k = 0 ; k < N * N ; k++){
      if(dp[i][j][k]){
          int t1 = k + abs(mat1[i][j+1] - mat2[i][j+1]);
          int t2 = abs(k + abs(mat1[i+1][j] - mat2[i+1][j]));
          dp[i][j+1][abs(k - abs(mat1[i][j+1] - mat2[i][j+1]))] = true;
          if(t1 < N * N)
          dp[i][j+1][abs(k + abs(mat1[i][j+1] - mat2[i][j+1]))] = true;
          dp[i+1][j][abs(k - abs(mat1[i+1][j] - mat2[i+1][j]))] = true;
          if(t1 < N * N)
          dp[i+1][j][abs(k + abs(mat1[i+1][j] - mat2[i+1][j]))] = true;
      }
    }
  }
 }
 for(int i = 0 ; i < N * N ; i++){
  if(dp[h - 1][w - 1][i]){
    cout << i << "\n";
    return 0;
  }
 } 
 return 0;
}

Measured memory_bytes: 57216
package main

import (
	"fmt"
)

func lastDigit(n int) int {
	last := 0
	for n > 0 {
		last = n % 10
		n /= 10
	}

	return last
}

func main() {
	var n int
	fmt.Scan(&n)

	last := lastDigit(n)
	repdigit := 100*last + 10*last + last

	if repdigit < n {
		repdigit += 111
	}
	fmt.Println(repdigit)
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {
    public static void debug(String str) {
        System.out.println(str);
    }

    public static void main(String[] args) {

        String S;
        long Q;
        StringBuilder sbFist = new StringBuilder();
        StringBuilder sbSecond = new StringBuilder();
        boolean traverse = false;

        try (Scanner sc = new Scanner(System.in)) {
            S = sc.next();
            Q = sc.nextLong();
            for(int i= 0;i < Q;i++){
                if(sc.nextInt() == 1){
                    //反転
                    traverse = !traverse;
                }else{
                    //文字列加える
                    if(!((sc.nextInt() == 1) ^ (!traverse))){
                        //前に
                        sbFist.append(sc.next());
                    }else{
                        sbSecond.append(sc.next());
                    }
                }
            }
        }
        String result;
        if(!traverse){
            result = sbFist.reverse().append(S).append(sbSecond).toString();
        }else {
            StringBuilder temp = new StringBuilder(S);
            result = sbSecond.reverse().append(temp.reverse()).append(sbFist).toString();
        }
        System.out.println(result);
        return;
    }
}


Measured memory_bytes: 118256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define enum(i,x,y) for(int i=(x);i<=(y);++i)
#define try(i,x,y) for(int i=(x);i>=(y);--i)
template <typename TYPE> inline void chkmax(TYPE &x,TYPE y){x<y?x=y:0;}
template <typename TYPE> inline void chkmin(TYPE &x,TYPE y){y<x?x=y:0;}
template <typename TYPE> void readint(TYPE &x)
{
    x=0;int f=1;char c;
    for(c=getchar();!isdigit(c);c=getchar())if(c=='-')f=-1;
    for(;isdigit(c);c=getchar())x=x*10+c-'0';
    x*=f;
}
const int MAXN=105;

ll n;
int cnt,a[MAXN];

int main()
{
	readint(n);++n;
	while(n)a[++cnt]=n%10,n/=10;
	cout<<(a[cnt]-1)+(cnt-1)*9<<endl;
    return 0;
}

Measured memory_bytes: 256
object Main extends App {
    for (Array(a, b, n) <- io.Source.stdin.getLines.map(_.split(" ").map(_.toInt))) {
        var (rem, res, i) = (a, 0, n)
        while (i > 0) {
            rem = rem % b * 10
            res += rem / b
            i -= 1
        }
        println(res)
    }
}

Measured memory_bytes: 44236
use proconio::input;

fn main() {
    input! {
        k: u64,
    }
    let mut result = 0; // 7, 77, 777 ...
    for i in 1..=k {
        result = (result * 10 + 7) % k;
        if result == 0 {
            println!("{}", i);
            return;
        }
    }
    println!("-1");
}


Measured memory_bytes: 2156
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

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

		boolean[][] has_cards = new boolean[4][13];
		Map<String, Integer> sutes = new HashMap<String, Integer>();
		String[] suite_rev = new String[]{"S", "H", "C", "D"};
		sutes.put("S", 0);
		sutes.put("H", 1);
		sutes.put("C", 2);
		sutes.put("D", 3);
		
		final int n = sc.nextInt();
		for(int i = 0; i < n; i++){
			final String sute = sc.next();
			final int num = sc.nextInt() - 1;
			
			has_cards[sutes.get(sute)][num] = true;
		}
		
		
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 13; j++){
				if(!has_cards[i][j]){
					System.out.println(suite_rev[i] + " " + (j + 1));
				}
			}
		}
		
	}

}

Measured memory_bytes: 18076
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;

long long INF = 1e18;
long long x[1010][1010];
long long d[1010];

int main(){
  int n, m;
  cin >> n >> m;

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      x[i][j] = INF;
    }
    d[i] = INF;
  }
  d[0] = 0;
  for (int i = 0; i < m; i++) {
    int a, b; long long c;
    cin >> a >> b >> c;
    x[a-1][b-1] = -c;
  }

  for (int i = 0; i < n-1; i++) {
    for (int v = 0; v < n; v++) {
      for (int w = 0; w < n; w++) {
        if (x[v][w] != INF && d[w] > d[v] + x[v][w]){
          d[w] = d[v] + x[v][w];
        }
      }
    }
  }

  //負の経路を判定
  vector<bool> roop(n);
  for (int v = 0; v < n; v++) {
    for (int w = 0; w < n; w++) {
      if (x[v][w] != INF && d[w] > d[v] + x[v][w]){
        d[w] = d[v] + x[v][w];
        roop[v] = true;
        roop[w] = true;
      }
    }
  }
  for (int v = 0; v < n; v++) {
    for (int w = 0; w < n; w++) {
      if (x[v][w] != INF && roop[v] == true){
        roop[w] = true;
      }
    }
  }

  if (roop[n-1] == true) printf("inf\n");
  else printf("%lld\n", -d[n-1]);
  return 0;
}

Measured memory_bytes: 8192
# include <stdio.h>
# include <string.h>
# include <stdlib.h>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <math.h>
# include <algorithm>
using namespace std;
# define pi acos(-1.0)
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
typedef long long LL;
typedef unsigned long long ULL;



int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if(c>=a&&c<=b)puts("Yes");
    else puts("No");
    return 0;
}





















Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
   int a,b,c;
   scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
   if(a<b&&b<c)
   {
      printf("Yes\n");
   }
   else
   {
      printf("No\n");
   }
   return 0;
}

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

int main(){
  int N;
  cin>>N;
  while(1){
    int a=N/100,b=N%100/10,c=N%10;
    
    if(a==b&&b==c){break;}
    N++;
  }
  
  cout <<N<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define repk(i,k,n) for (ll i = k; i < (ll)(n); ++i)
#define MAX 500000001000000000
#define MOD 1000000007
typedef long long  ll;

using namespace std;

double ans, cnt;

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

	int N;
	cin >> N;

	const double PI = 3.14159265358979323846;


	ans = 2 * N * PI;

	printf("%.11lf", ans);

	return 0;
}


Measured memory_bytes: 3728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(2e4 + 5);
#define REP(i, n) for (int i = 0; i < n; i++)

int n, m, c[16], x[MAX_N], dp[MAX_N][256];  // iまでみて信号をjにしたときの最小

int main() {
    while(cin >> n >> m, n){
        REP(i,m) cin >> c[i];
        REP(i,n) cin >> x[i];

        REP(i,n+1)fill(dp[i],dp[i]+256,IINF/2);
        dp[0][128] = 0;

        REP(i,n){
            REP(j,256){
                REP(k,m){
                    int y = max(0,min(255,j+c[k]));
                    dp[i+1][y] = min(dp[i+1][y], dp[i][j]+int(pow(x[i]-y,2)));
                }
            }
        }
        int ans = IINF;
        REP(i,256) ans = min(ans, dp[n][i]);
        cout << ans << endl;
    }
    return 0;
}



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

#define ll          long long
#define pb          push_back
#define endl        '\n'
#define mii         map<ll,ll>
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define INF         (1ll<<60)
#define rep(i,a,b)  for(ll i=a;i<=b;i++)
#define rrep(i,a,b)  for(ll i=a;i>=b;i--)
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
const int N=100005;
void solve(){
    ll n,m;
    cin>>n>>m;
    if(m==1 || n==1){
        cout<<1<<endl;
        return;
    }
    ll temp=(n*m);
    temp=(temp+1)/2;
    cout<<temp<<endl;
}
signed main()
{
    ios
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
        solve();
    }
    time
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int a[3],b[2],i,m1=2001,m2=2001;
  for(i=0;i<3;i++){
    scanf("%d",&a[i]);
    if(m1>a[i])m1=a[i];
  }
  for(i=0;i<2;i++){
    scanf("%d",&b[i]);
    if(m2>b[i])m2=b[i];
  }
  printf("%d\n",m1+m2-50);
  return 0;
}

Measured memory_bytes: 592
import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int a = input.nextInt();
        int b = input.nextInt();
        System.out.println("a " + (a==b?"==":(a>b?">":"<")) + " b");
    }
}

Measured memory_bytes: 17160
import numpy as np

N = int(input())

red_list = []
blue_list = []

for _ in range(N):
    red_list.append(list(map(int, input().split())))
for _ in range(N):
    blue_list.append(list(map(int, input().split())))
red_list.sort(key = lambda x : x[1], reverse = True)
blue_list.sort(key = lambda x : x[0])

count = 0
for b in blue_list:
    for ri, r in enumerate(red_list):
        if b[0] > r[0] and b[1] > r[1]:
            count += 1
            del red_list[ri]
            break

print(count)

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

int main(){
  ll n,m;
  ll inf = ll(1)<<50;
  while(cin>>n>>m,n){
    vector<ll> c(m);
    rep(i,m) cin>>c[i];
    vector<ll> x(n);
    rep(i,n) cin>>x[i];

    vector<vector<ll>> dp(n+1,vector<ll>(256,inf));
    dp[0][128] = 0;

    rep(i,n){
      rep(j,256){
	rep(k,m){
	  ll nj = j + c[k];
	  if(nj < 0) nj = 0;
	  else if(255 < nj) nj = 255;
	  dp[i+1][nj] = min(dp[i+1][nj], dp[i][j]+(x[i]-nj)*(x[i]-nj));
	}
      }
    }

    ll ans = inf;
    rep(j,256) ans = min(ans, dp[n][j]);
    cout << ans << endl;
  }
}
	
      



Measured memory_bytes: 43676
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

a, b, k = map(int, input().split())
l = []
for i in range(k):
    if a+i <= b:
        l.append(a+i)
    if b-i >= a:
        l.append(b-i)
# print(l)
ll = sorted(set(l))
for i in range(len(ll)):
    print(ll[i])


Measured memory_bytes: 3832
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<time.h>
#include<iostream>
#include<queue>
#include<stack>
#include<map>
#include<cmath>
#define ll long long
#define oo 0x7fffffff
using namespace std;
inline int read()
{
	int out=0,fh=1;
	char cc=getchar();
	while ((cc>'9'||cc<'0')&&cc!='-')
		cc=getchar();
	if (cc=='-')
		{
			fh=-1;
			cc=getchar();
		}
	while (cc>='0'&&cc<='9')
		{
			out=out*10+cc-'0';
			cc=getchar();
		}
	return out*fh;
}
const int MAXN=5010;
const int mod=1e9+7;
inline int add(int a,int b)
{
	return (a+b) % mod;
}
inline int sub(int a,int b)
{
	return a-b%mod<0?  a-b%mod+mod : a-b%mod;
} 
inline int mul(int a,int b)
{
	return 1ll * a * b % mod; 
}
int n;
vector<int> G[MAXN];
int siz[MAXN];
int dp[MAXN][MAXN],g[MAXN],t[MAXN];
//dp[i][j]表示以i为根的子树中,恰有j个点与i的父亲相连的方案数 
//g[i]表示把i个点两两配对的方案数目
void init()
{
	g[0]=1;
	for(register int i=2;i<=n;i+=2)
		g[i]=mul(g[i-2],i-1);
}
void dfs(int u,int fa)
{
	siz[u]=1;
	dp[u][1]=1;
	for(register int i=0;i<G[u].size();++i)
		{
			int v=G[u][i];
			if(v==fa)
				continue;
			dfs(v,u);
			for(register int j=0;j<=siz[u];++j)
				{
					t[j]=dp[u][j];
					dp[u][j]=0;
				}
			for(register int j=0;j<=siz[u];++j)
				for(register int k=0;k<=siz[v];++k)
					dp[u][j+k]=add(dp[u][j+k],mul(t[j],dp[v][k]));
			siz[u]+=siz[v];
		}
	for(register int i=0;i<=siz[u];i+=2)
		dp[u][0]=sub(dp[u][0],mul(dp[u][i],g[i]));
}
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	n=read();
	for(register int i=1;i<n;++i)
		{
			int u=read(),v=read();
			G[u].push_back(v);
			G[v].push_back(u);
		}
	init();
	dfs(1,0);
	printf("%d",mod-dp[1][0]);
	//fclose(stdin);
	//fclose(stdout);
	return 0;
}


Measured memory_bytes: 97536
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int cnt = 0;
		while(true){
			cnt++;
			int n = sc.nextInt();
			if(n==0) break;
			
			double[] x = new double[n];
			double[] y = new double[n];
			for(int i=0;i<n;i++){
				x[i] = sc.nextDouble();
				y[i] = sc.nextDouble();
			}
			
			double sum = 0;
			double a, b, c, d;
			for(int i=1;i<=n-2;i++){
				a = x[i] - x[0];
				b = y[i] - y[0];
				c = x[i+1] - x[0];
				d = y[i+1] - y[0];
				sum += a*d - b*c;
			}
			
			System.out.println(cnt + " " + Math.abs(sum)/2);
		}	
	}	
}

Measured memory_bytes: 23244
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m;
  cin >> n >> m;
  
  
  int N=(n*(n-1))/2;
  int M=(m*(m-1))/2;
  int ans=N+M;
  
  
  cout << ans << endl;
}
  

Measured memory_bytes: 256
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] x = new int[N];
		int[] y = new int[N];
		int[] h = new int[N];
		for(int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
			h[i] = sc.nextInt();
		}
		boolean check = true;
		for(int X = 0; X <= 100; X++) {
			for(int Y = 0; Y <= 100; Y++) {
				int H = 1;
				for(int i = 0; i < N; i++) {
					if(h[i] != 0) {
						H = Math.abs(X - x[i]) + Math.abs(Y - y[i]) + h[i];
						break;
					}
				}
				check = true;
				for(int i = 0; i < N; i++) {
					if(h[i] != Math.max(H - Math.abs(X - x[i]) - Math.abs(Y - y[i]), 0)) check = false;
				}
				if(check) {
					System.out.println(X+" "+Y+" "+H);
					break;
				}
			}
			if(check) break;
		}
	}
}


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

int main() {
	int k, x;
	cin >> k >> x;
	for (int i = x - k + 1; i < x + k; i++) {
		cout << i << " ";
	}

}

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

#define SORT(v) sort(v.begin(),v.end())
#define si(n) scanf("%d",&n)
#define sii(n,m) scanf("%d %d",&n,&m)
#define sl(n) scanf("%lld",&n)
#define sll(n,m) scanf("%lld %lld",&n,&m)
#define ss(cad) scanf("%s",cad)
#define PB push_back
#define fst first
#define scn second
#define DBG(x) cerr << #x << " = " << (x) << endl; 
#define M 1000000007
#define N_MAX 100010

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef pair<int,int> pi;
typedef vector<pi> vp;

int main()
{
	char cad[10];
	ss(cad);
	for(int i = 1; i< 4; i++)
	{
		if(cad[i-1] == cad[i])
		{
			printf("Bad\n");
			return 0;
		}
	}
	printf("Good\n");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n-1); i >= 0; i--)
#define loop(i, r, n) for (int i = (r); i < (n); i++)
#define pb push_back
#define all(in) in.begin(),in.end()

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; }

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

int main(){
    int n, q; cin >> n >> q;
    string s; cin >> s;
    int left = 0, right = n-1;
    vector<char> t(q), d(q); rep(i,q) cin >> t[i] >> d[i];
    rrep(i,q){
        if(s[left] == t[i] && d[i] == 'L') left++;
        else if(left > 0 && s[left-1] == t[i] && d[i] == 'R') left--;
        if(s[right] == t[i] &&  d[i] == 'R') right--;
        else if(right < n-1 && s[right+1] == t[i] && d[i] == 'L') right++;
        if(right <= left){ cout << 0 << endl; return 0; }
    }
    cout << right - left + 1 << endl;
    return 0;
}

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

#define ulli unsigned long long int
#define ll long long
#define ld long double

using namespace std; 
void solve(); 

int main() 
{ 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t=1; 
    // cin>>t; 
    while(t--) 
    { 
      solve(); 
      cout<<"\n"; 
    } 

    cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl; 
    return 0; 
} 

void solve() 
{ 
    int a, b;

    cin >> a >> b;

    cout << a * b << "\n";
}


Measured memory_bytes: 3804
L,R = [int(i) for i in input().split()]

L_amari= L%2019
R_amari= R%2019

if R-L <2018:
    if L_amari <= R_amari:
        if L_amari==0:
            ans=0
        else:
            amari_list = [i for i in range(L_amari,R_amari+1)]
            amari_min=114514
            for i in range(len(amari_list)):
                for j in range(i+1,len(amari_list)):
                    amari=amari_list[i]*amari_list[j]%2019
                    if amari_min > amari:
                        amari_min = amari
            ans =amari_min
    else:
        ans=0
else:
    ans=0

print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>

#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using namespace std;
using vi = vector<int64_t>;
using vvi = vector<vi>;

int main(int argc, const char * argv[]) {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    int64_t n,m;
    cin >> n >> m;
    cout << (n-1) * (m-1) << endl;
}


Measured memory_bytes: 256