akhauriyash/Code-Regression huggingface dataset:
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var A, B int
	inputs := scanIntNums()
	A = inputs[0]
	B = inputs[1]

	priceA := math.Ceil(float64(A) / 0.08)
	priceB := math.Ceil(float64(B) / 0.1)

	if int(priceA*0.1) == B {
		fmt.Println(int(priceA))
	} else if int(priceB*0.08) == A {
		fmt.Println(int(priceB))
	} else {
		fmt.Println(-1)
	}
}

func scanIntNums() (nums []int) {
	sc.Scan()
	numString := strings.Split(sc.Text(), " ")

	nums = make([]int, len(numString))
	var err error

	for i := 0; i < len(nums); i++ {
		nums[i], err = strconv.Atoi(numString[i])
		if err != nil {
			panic(err)
		}
	}
	return nums
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
const int IINF = INT_MAX;

int main() {
    int n, a[10], l=IINF, r=IINF;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    for(int i=0;i<n;i++){
        int w;
        cin >> w;
        if(a[i]) l = min(l, w);
        else r = min(r, w);
    }
    if(l==IINF || r==IINF){
        cout << 0 << endl;
    }
    else{
        cout << l+r << endl;
    }
    return 0;
}


Measured memory_bytes: 3084
n, q = map(int, input().split())
order = []
dic = {}
time = 0
for _ in range(n):
    x, y = input().split()
    order.append(x)
    dic[x] = int(y)

while order:
    x = dic[order[0]] - q
    if  x > 0:
        dic[order[0]] = x
        order.append(order[0])
        del order[0]
        time += q
    else:
        time += (x + q)
        print(order[0], time)
        del order[0]


Measured memory_bytes: 11960
import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;
import std.math, std.random, std.bigint, std.datetime, std.format;
void main(string[] args){ if(args.length > 1) if(args[1] == "-debug") DEBUG = 1; solve(); }
void log()(){ writeln(""); } void log(T, A ...)(T t, lazy A a){ if(DEBUG) write(t, " "), log(a); } bool DEBUG = 0; 
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- //

void solve(){
	int n = read.to!int;
	long[] as, bs;
	foreach(i; 0 .. n){
		as ~= read.to!long;
		bs ~= read.to!long;
	}
	
	long sum;
	foreach(a; as) sum += a;
	
	long best = sum;
	foreach(i; 0 .. n){
		long a = as[i], b = bs[i];
		if(a <= b) continue;
		if(b < best) best = b;
	}
	
	(sum - best).writeln;

}
/*
A君はできるだけ粘りたい。
B君よりも高い山を1つ残しておけばいくらでも粘れるので、
最終的には1つの山だけが残る形にするまで粘ることができる。
その際A君にとっては、残る山の高さは低いほうがよい。
つまり
「A君の方が高い山のうちでB君の高さが最も低いもの」
が残る山の高さ。
※これが無いときは初期状態で全ての山のABが一致しているときで、答えは0。
*/

Measured memory_bytes: 3708
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N=int(input())
c=0
for i in range(1,N+1):
    if(0<i<10 or 99<i<10**3 or (10**4-1)<i<10**5):c+=1

print(c)

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


int main(){
    int N;
    string S;
    cin >> N >>S;
    int dp[N];
    int minpointer=0;
    int dpmin=0;
    int countE=0;
    dp[0]=0;
    for(int i=1;i<N;i++){
        dp[i]=dp[i-1];
        if(S[i-1]=='W'){
            dp[i]++;
        }
        if(S[i]=='E'){
            dp[i]--;
            countE++;
        }
        if(dp[i]<dpmin){
            minpointer=i;
            dpmin=dp[i];
        }
    }
    int ans=dp[minpointer]+countE;
    cout << ans;
    return 0;
}

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

int n, x[200005], id[200005], B[200005];

bool cmp(int a, int b) {
    return x[a] < x[b];
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &x[i]), id[i] = i;
    sort(id + 1, id + n + 1, cmp);
    int mid = n / 2;
    for (int i = 1; i <= mid; i++) B[id[i]] = x[id[mid + 1]];
    for (int i = mid + 1; i <= n; i++) B[id[i]] = x[id[mid]];
    for (int i = 1; i <= n; i++) printf("%d\n", B[i]);
    return 0;
}


Measured memory_bytes: 4480
#include<cstdio>
#include<algorithm>
using namespace std;
const int INF=2000001000;
int main()
{
	int a,b,c,x,y;
	scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
	if (x<=y)
	{
		int ans=INF;
		for (int i=0;i<=y;i++)
		{
			int tmp=c*i*2+max(x-i,0)*a+max(y-i,0)*b;
			ans=min(ans,tmp);
		}
		printf("%d\n",ans);
	}
	else
	{
		int ans=INF;
		for (int i=0;i<=x;i++)
		{
			int tmp=c*i*2+max(x-i,0)*a+max(y-i,0)*b;
			ans=min(ans,tmp);
		}
		printf("%d\n",ans);
	}
	return 0;
} 

Measured memory_bytes: 128
n = int(input())
a = list(map(int, input().split()))


dp = [[0]*(n+1) for i in range(n+1)]

a_accum = [0]
for i in range(n):
    a_accum.append(a_accum[-1] + a[i])

for k in range(2, n+1):
    for i in range(n-k+1):
        mini = 10**15
        for j in range(i+1, i+k):
            mini = min(dp[i][j] + dp[j][i+k], mini)
        dp[i][i+k] = mini + a_accum[i+k]-a_accum[i]
print(dp[0][n])


Measured memory_bytes: 42732
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
RC112 B
"""

n,t = map(int,input().split())

costs = []
for i in range(n):
    ci,ti = map(int,input().split())
    if ti <= t:
        costs.append(ci)

if bool(costs):
    print(min(costs))
else:
    print('TLE')



Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans,n,k,dp[5005],a[5005];
void add(ll x){
    for(ll i=k-1;i>=x;i--)dp[i] = (dp[i] + dp[i-x]);
}
void del(ll x){
    for(ll i=0;i<k-x;i++)dp[i+x]=(dp[i+x]-dp[i]);
}
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cin>>n>>k;
    for(ll i=0;i<n;i++)cin>>a[i],a[i]=min(a[i],k);
    dp[0]=1;
    for(ll i=0;i<n;i++)add(a[i]);
    for(ll i=0;i<n;i++){
        del(a[i]);
        ll fl=0,l=k-a[i];
        for(ll j=l;j<k;j++)if(dp[j])fl=1;
        if(!fl)ans++;
        add(a[i]);
    }
    cout<<ans;
}

Measured memory_bytes: 384
n = int(input())
num_list=list(map(int,input().split()))
ans = 1
flg = True
if 0 in num_list:
  print("0")
else:
  for i in range(n):
    ans = ans*num_list[i]
  
    if ans > 10**18:
      print("-1")
      flg = False
      break
  if flg:
    print(ans)

Measured memory_bytes: 21660
#include <iostream>

using namespace std;
using ll = long long;

ll gcd2(int a, int b) {
  int x = min(a, b);
  int y = max(a, b);
  while (y % x) {
    int z = x;
    x = y % x;
    y = z;
  }
  return x;
}

ll gcd(int a, int b, int c) {
  return gcd2(gcd2(a, b), c);
}

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

Measured memory_bytes: 3600
h,w = map(int,input().split())
a = []
for i in range(h):
    ai = list(map(int,input().split()))
    a.append(ai)
ans = []
for i in range(h):
    for j in range(w-1):
        if a[i][j] % 2 == 1:
            ans.append([i+1,j+1,i+1,j+2])
            a[i][j+1] += 1
for i in range(h-1):
    if a[i][-1] % 2 == 1:
        ans.append([i+1,w,i+2,w])
        a[i+1][-1] += 1
print(len(ans))
for i,j,k,l in ans:
    print(i,j,k,l)

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

long long n, a, b, c, d;
string s;

bool solve();

int main() {
  cin >> n >> a >> b >> c >> d >> s;
  if(solve())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

bool solve() {
  --a, --b, --c, --d;
  bool ch = 0;
  for(int i = a + 1; i <= c; ++i)
    if(s[i] == s[i - 1] && s[i] == '#') return 0;
  for(int i = b + 1; i <= d; ++i)
    if(s[i] == s[i - 1] && s[i] == '#') return 0;
  if(c < d) return 1;
  for(int i = b; i <= d; ++i)
    if(i > 0 && i + 1 < n && s[i - 1] == s[i] &&
       s[i] == s[i + 1] && s[i] == '.')
      ch = 1;
  return ch;
}

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

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

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> S(H, vector<char>(W));
  rep(i, H) {
    rep(j, W) { cin >> S[i][j]; }
  }

  auto A = S;

  rep(i, H) {
    rep(j, W) {
      if (A[i][j] == '#')
        continue;

      int cnt = 0;
      repp(ii, max(0, i - 1), min(H - 1, i + 1)) {
        repp(jj, max(0, j - 1), min(W - 1, j + 1)) {
          if (S[ii][jj] == '#')
            cnt++;
        }
      }
      A[i][j] = cnt + '0';
    }
  }

  rep(i, H) {
    rep(j, W) { cout << A[i][j]; }
    cout << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
string a,s;
int main(){
    cin >> a;
    s = a;
    reverse(a.begin(),a.end());
    for (int i = 0; i < a.size(); i++){
        if (a[i] == 'b') a[i] = 'd';
        else if (a[i] == 'd') a[i] = 'b';
        else if (a[i] == 'p') a[i] = 'q';
        else a[i] = 'p';
    }
    if (a == s)
        cout << "Yes";
    else cout << "No";
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef vector<double> Vec;
typedef vector<Vec> Mat;
typedef pair<ll,ll> P;
typedef pair<double,ll> Pd;
typedef priority_queue<P,vector<P>,greater<P>> P_queue;
typedef priority_queue<Pd,vector<Pd>,greater<Pd>> Pd_queue;

const ll MOD=998244353;
const ll mod=1000000007;
const ll INF=1e15;
vec dx={1,0,-1,0};
vec dy={0,1,0,-1};

#define REP(i,a,b) for(int i=(int)a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define ALL(a) a.begin(),a.end()
#define SORT(a) sort(ALL(a))
#define U_ERASE(V) V.erase(unique(ALL(V)), V.end());
#define ADD(a,b) a=(a+b)%mod

ll d[101][101];
ll q[101];
ll Dist[101];
const double BIG=1000000.0;
double DEL=1e-8;

void init(){
    rep(i,101) rep(j,101) d[i][j]=INF;
    rep(i,101) q[i]=-1;
    rep(i,101) Dist[i]=INF;
}

Vec gauss_jordan(const Mat &A, const Vec &b){
    ll N=A.size();
    Mat B(N,Vec(N+1,0));
    rep(i,N) rep(j,N) B[i][j]=A[i][j];
    rep(i,N) B[i][N]=b[i];
    rep(i,N){
        ll pivot=i;
        REP(j,i,N) if(abs(B[j][i])>abs(B[pivot][i])) pivot=j;
        swap(B[i],B[pivot]);
        if(abs(B[i][i])<DEL) return Vec();
        REP(j,i+1,N+1) B[i][j]/=B[i][i];
        rep(j,N) if(i!=j){
            REP(k,i+1,N+1) B[j][k]-=B[j][i]*B[i][k];
        }
    }
    Vec x(N);
    rep(i,N) x[i]=B[i][N];
    return x;
}

double Solve(ll N, ll S, ll T){
    init();
    rep(i,N) cin>>q[i];
    rep(i,N) rep(j,N){
        ll x; cin>>x;
        if(x>0) d[i][j]=x;
    }
    P_queue Q;
    Q.push(mp(0,T));
    Dist[T]=0;
    while(!Q.empty()){
        ll a=Q.top().first, b=Q.top().second;
        Q.pop();
        if(a==Dist[b]){
            //cout<<a<<':'<<b<<endl;
            rep(i,N) if(d[b][i]+a<Dist[i]){
                Dist[i]=d[b][i]+a;
                Q.push(mp(Dist[i],i));
            }
        }
    }
    if(Dist[S]==INF) return -1;
    //rep(i,N) cout<<Dist[i]<<' ';
    //cout<<endl;
    
    Mat C(N, Vec(N,0)); Vec B(N,0);
    rep(i,N){
        C[i][i]=1;
        if(i==T) continue;
        vec kari;
        rep(j,N) if(d[i][j]<INF){
            if(!q[i]) kari.pb(j);
            else if(d[i][j]+Dist[j]==Dist[i]) kari.pb(j);
        }
        ll Count=0;
        ll K=kari.size();
        C[i][i]=K;
        rep(j,K) Count+=d[i][kari[j]];
        rep(j,K) C[i][kari[j]]=-1;
        B[i]=Count;
    }
    //rep(i,N) cout<<B[i]<<' ';
    Vec x=gauss_jordan(C,B);
    //cout<<x.size()<<endl;
    return x[S];
}

int main(){
    Vec ans;
    while(true){
        ll a,b,c; cin>>a>>b>>c;
        if(!a && !b && !c) break;
        b--; c--;
        ans.pb(Solve(a,b,c));
    }
    rep(i,ans.size()) {
        if(ans[i]<0) cout<<"impossible"<<endl;
        else cout<<setprecision(13)<<ans[i]<<endl;
    }
}


Measured memory_bytes: 3432
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o<<endl;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
//V<ll>F,R;void setF(int n,int mod){F=R=V<ll>(++n);F[0]=1;FOR(i,1,n)F[i]=F[i-1]*i%mod;R[n-1]=modInv(F[n-1],mod);FORR(i,n-1,1)R[i-1]=R[i]*i%mod;}
//ll comb(int a,int b,int m){return a<b||b<0?0:F[a]*R[b]%m*R[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7; //998244353;
const int N = 1e5;
int a, b, c;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> a >> b >> c;
  cout << ((a+b+c>=22) ? "bust" : "win") << endl;
}

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

int main(){
  int N,sumA=0,sumB=0;
  cin >> N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin >> A.at(i);
  }
  sort(A.begin(),A.end());
  reverse(A.begin(),A.end());
  for(int i=0;i<N;i++){
    if(i%2==0){
      sumA+=A.at(i);
    }
    else{
      sumB+=A.at(i);
    }
  }
  cout << sumA-sumB << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <limits>
#include <string>
#include <bitset>
#include <functional>
#include <iomanip>

using namespace std;
using lint = long long;
using vi = vector<int>;
using vl = vector<int>;
using pii = pair<int, int>;
using pll = pair<lint, lint>;
using pqi = priority_queue<int>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define mp(x, y) make_pair((x), (y))
#define all(x) (x).begin(), (x).end()
#define foreach(it, x) for (auto it = (x).begin(); it != (x).end(); it++)
#define space (char)0x20

constexpr lint MOD = 1e9 + 7;
double A, B, C, D, E, F, G, H, I, J, K, L, M, N;
lint O, P, Q, R, S, T, U, V, W, X, Y, Z;
// string s;

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

	cin >> L;

    cout << setprecision(20) << L * L * L / 27 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int W, H, x, y, r;
  scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
  if((x - r) >=0 && (x + r) <= W && (y - r) >= 0 && (y + r) <= H){
    printf("Yes\n");
  }
  else{
    printf("No\n");
  }
  return 0;
}


Measured memory_bytes: 2140
#include<bits/stdc++.h>
using namespace std;
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define faster() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const long long int infLL = 9000000000000000000;
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(a) (a).begin(),(a).end()
#define mx_int_prime 999999937
const int inf = 2000000000;
const double PI = acos(-1);
const double eps = 1e-9;
typedef long double ld;
#define MOD 1000000007
typedef long long ll;
const int mx=2e5+125;
ll p[mx],a[mx],b[mx];
#define PB push_back
#define endl '\n'
#define S second
#define F first
int main()
{
    faster();
    string s,t,u;
    cin>>s>>t;
    int a,b;
    cin>>a>>b;
    cin>>u;
    int len1=s.size();
    int len2=t.size();
    if(s==u)
        cout<<a-1<<" "<<b<<endl;
    else
        cout<<a<<" "<<b-1<<endl;
    return  0;
}


Measured memory_bytes: 3536
import java.io.File;
import java.io.IOException;
import java.util.*;
 
public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		String N = sc.next();
		System.out.println(N.charAt(0) == N.charAt(2)? "Yes" : "No");
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 11;

int tacke[N][N];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,d;
    cin >> n >> d;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= d; j++){
            cin >> tacke[i][j];
        }
    }
    ll sol = 0;
    for(int i = 1; i <= n; i++){
        for(int j = i+1; j <= n; j++){
            ll sum = 0;
            for(int k = 1; k <= d; k++){
                sum += (tacke[i][k]-tacke[j][k])*(tacke[i][k]-tacke[j][k]);
            }
            ll kv = sqrt(sum);
            if(kv*kv == sum){
                sol++;
            }
        }
    }
    cout << sol << endl;
}


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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

constexpr int64 P = 1000000007;

struct FiniteField {
 private:
  int64 x;
 public:
  FiniteField(int64 x) : x(x) {
    if (x > P || x < 0) { cerr << "Invalied FiniteField!" << endl; exit(1); }
  }
  FiniteField() : x(0) {}
  int64 Value() const { return x; }
  inline FiniteField operator+(FiniteField o) const {
    FiniteField r(*this); r += o; return r;
  }
  inline FiniteField operator-(FiniteField o) const {
    FiniteField r(*this); r -= o; return r;
  }
  inline FiniteField operator* (FiniteField o) const {
    FiniteField r(*this); r *= o; return r;
  }
  inline FiniteField operator/ (FiniteField o) const {
    FiniteField r(*this); r /= o; return r;
  }
  inline void operator+= (FiniteField o) { x = (x + o.x) % P; }
  inline void operator-= (FiniteField o) { x = (x + P - o.x) % P; }
  inline void operator*= (FiniteField o) { x = (x * o.x) % P; }
  void operator/=(FiniteField o) {
    int64 p = P - 2; while (p) { if (p % 2) { *this *= o; } o *= o; p /= 2; }
  }
};

FiniteField Factorial(int x) {
  FiniteField r = 1;
  for (int i = 1; i <= x; i++) {
    r *= i;
  }
  return r;
}

FiniteField Solve() {
  int x, y;
  cin >> x >> y;
  if ((x + y) % 3 != 0) {
    return 0;
  }
  int k = (x + y) / 3;
  // cout << "k: " << k << endl;
  if (x < k || 2 * k < x) return 0;
  int l = x - k;
  return Factorial(k) / Factorial(l) / Factorial(k - l);
}

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

  cout << Solve().Value() << endl;
}

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

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

int main() {

    int n, m; cin >> n >> m;

    vector<int> a(n);
    int sum = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        sum += a[i];
    }

    sort(a.rbegin(), a.rend());

    for (int i = 0; i < m; ++i) {
        if (a[i] * 4 * m < sum) {
            puts("No");
            return 0;
        }
    }

    puts("Yes");
}

Measured memory_bytes: 256
n,h=map(int,input().split())
A=[]
B=[]
for i in range(n):
  a,b=map(int,input().split())
  A.append(a)
  B.append(b)
A=max(A)
B.sort(reverse=True)
count=0
for i in B:
  if A>i:
    break
  else:
    if h>0:
      h-=i
      count+=1
    else:
      break
if h%A==0 and h>0:
  print(count+h//A)
elif h%A!=0 and h>0:
  print(count+h//A+1)
else:
  print(count)

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

#define rep(i, first, to) for(int i = first; i < to; ++i)
#define REP(i, first, to) for(int i = first; i <= to; ++i)
#define MyDebug

#ifdef MyDebug
	#define debug(x) cout << #x << " : " << x << endl
	#define debugP(x) cout << x << endl
#else
	#define debug(x)
	#define debugP(x)
#endif

using namespace std;
typedef long long ll;

list<int> ansList;
int a[(int)1e5];
int n;
void solve() {
	cin >> n;
	rep (i, 0, n) {
		int v;
		cin >> v;
		if (i % 2 == 0) {
			ansList.push_back(v);
		} else {
			ansList.push_front(v);
		}
	}
	if (n % 2 == 0) reverse(ansList.begin(), ansList.end());
	cout << ansList.back();
	ansList.pop_back();
	while(!ansList.empty()) {
		cout << " " << ansList.back();
		ansList.pop_back();
	}
	cout << endl;
}

int main() {
	solve();
	return 0;
}


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

#ifdef DEBUG
    #define IFD if(true)
#else
    #define IFD if(false)
#endif

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

int main()
{
    int N;
    int A[100001];
    int l_pre[100002];
    int l_post[100002];

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

    l_pre[0] = 0;
    for(int i = 1; i <= N; i++) {
        l_pre[i] = gcd(A[i], l_pre[i - 1]);
        IFD cout << l_pre[i] << " ";
    }
    IFD cout << endl;

    l_post[N + 1] = 0;
    for(int i = N; i >= 1; i--) {
        l_post[i] = gcd(l_post[i + 1], A[i]);
        IFD cout << l_post[i] << " ";
    }
    IFD cout << endl;

    int ans = -1;
    for(int i = 1; i <= N; i++) {
        ans = max(ans, gcd(l_pre[i - 1], l_post[i + 1]));
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1408
#include<stdio.h>

int main(void)
{
    int W, H, x, y, r; scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
    
    if ( 0+r <= x && x <= W-r && 0+r <= y && y <= H-r)
        printf("Yes\n");
    else
        printf("No\n");
        
    return 0;
}


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

ans = min(h)
h_ = [n - ans for n in h] + [0]
while max(h_) > 0:
    j = -1
    for i, n in enumerate(h_):
        if n == 0:
            if (j + 1) < i:
                m = min(h_[j+1:i])
                ans += m
                for k in range(j+1, i):
                    h_[k] = h_[k] - m
            j = i

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h> 
using namespace std; 
int main (){
    string S,T;
    cin >> S >> T;
    int i,ans=0;
    for(i=0;i<3;i++){
    if(S[i] == T[i])
    ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T> >;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repb(i, n) for(ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define reprb(i, a, b) for(ll i = (a)-1; i >= (b); i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(unsigned long long x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
template<class S, class T>inline bool chmax(S &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class S, class T>inline bool chmin(S &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n, q;
    cin >> n >> q;
    vll a(n);
    rep(i, n){
        cin >> a[i];
    }
    vll x(q);
    rep(i, q){
        cin >> x[i];
    }
    // cond[i].f <= x < cond[i+1].f -> ans = cond[i].s
    vp cond;
    ll s = 0;
    for(ll i = n-1; i >= 0; i -= 2){
        s += a[i];
    }
    for(ll i = n-2; 2*i+1-n >= 0; i--){
        cond.emplace_back((a[2*i+1-n]+a[i])>>1, s);
        s -= a[2*i+1-n];
        s += a[i];
    }
    cond.emplace_back(0, accumulate(ALL(a), 0ll)-accumulate(a.begin(), a.begin()+n/2, 0ll));
    reverse(ALL(cond));
    rep(i, q){
        auto itr = lower_bound(ALL(cond), pll(x[i], 0));
        itr--;
        cout << itr->second << endl;
    }
    return 0;
}

Measured memory_bytes: 4212
#include<stdio.h>

int min(int A,int B){
    if(A>=B){
        return A;
    }else{
        return B;
    }
};

int main(){
    int A,B,K;
    int i;
    int result;
    int count=0;
    scanf("%d %d %d",&A,&B,&K);
    for(i=min(A,B);i>=1;i--){
        if(A%i==0 && B%i==0){
            count+=1;
            if(count==K){
                printf("%d\n",i);
                break;
            }
        }
    }
    return 0;
}

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

const int inf = 1e18;

int calc(int a, int b, int x) {
    int ret = inf;
    ret = min(ret, abs(a - x) + abs(a - b));
    ret = min(ret, abs(b - x) + abs(a - b));
    return ret;
}
signed main() {
    int A, B, Q;
    cin >> A >> B >> Q;

    vector<int> s(A), t(B);
    for (int& x : s) cin >> x;
    for (int& x : t) cin >> x;
    s.insert(s.end(), {-inf, inf});
    t.insert(t.end(), {-inf, inf});
    sort(s.begin(), s.end());
    sort(t.begin(), t.end());

    for (int i = 0; i < Q; i++) {
        int x;
        cin >> x;

        auto a = lower_bound(s.begin(), s.end(), x);
        auto b = lower_bound(t.begin(), t.end(), x);

        int ans = inf;
        ans = min(ans, calc(*a, *b, x));
        ans = min(ans, calc(*a, *(b - 1), x));
        ans = min(ans, calc(*(a - 1), *b, x));
        ans = min(ans, calc(*(a - 1), *(b - 1), x));

        cerr << " " ;
        cout << ans << endl;
    }
}


Measured memory_bytes: 2912
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>

#include <iomanip>
#include <list>
#define fo(i,n) for(int i=0;i<n;i++)
#define ll long long


using namespace std;
int main(){
int n;
cin>>n;

if(n%2==0) cout<<(float)1/2;
else cout<<(float)(n+1)/(2*n);

}

Measured memory_bytes: 256
#map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
import sys
for i in range(n):
    if a[i]%2==0:
        if a[i]%3!=0 and a[i]%5!=0:
            print('DENIED')
            sys.exit()
print('APPROVED')

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

namespace ABC060Shiritori
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] vals = Console.ReadLine().Split(' ');

            if(vals[0][vals[0].Length-1] == vals[1][0] && vals[1][vals[1].Length-1] == vals[2][0])
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }

        }
    }
}

Measured memory_bytes: 11092
n = gets.to_i
aa = gets.chomp.split.map(&:to_i)

bb = Hash.new{|h, s| h[s] = 0}
bb[0] = 1

sum = 0
res = 0
(0...n).each do |i|
  sum += aa[i]
  res += bb[sum]
  bb[sum] += 1
end

puts(res)

Measured memory_bytes: 31108
#include <bits/stdc++.h>
using namespace std;
int m,d,ans;
int main(){
cin>>m>>d;
for(int k=1;k<=m;k++){
   for(int i=22;i<=d;i++){
    int a=i/10;
    int b=i%10;
    if(a*b==k && a>=2 && b>=2){
        ans++;
    }
   }
}
cout<<ans;
return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		String x = "," + sc.next() + ",";
		String y = "," + sc.next() + ",";
		String a = ",1,3,5,7,8,10,12,";
		String b = ",4,6,9,11,";

		if (a.contains(x) && a.contains(y)) {
			System.out.println("Yes");
		} else if (b.contains(x) && b.contains(y)) {
			System.out.println("Yes");
		} else if (x.equals(",2,") && y.equals(",2,")) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}
}


Measured memory_bytes: 23252
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    res = dict()
    for i in range(n):
        s, n = input().split()
        if s in res:
            res[s].update({int(n): i+1})
        else:
            res[s] = {int(n): i+1}
    for i in sorted(res):
        for j in sorted(res[i].keys(), reverse=True):
            print(res[i][j])
    
if __name__ == '__main__':
    main()

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

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;

int a[100000];

int main(){
    int N;

    cin >> N;

    for(int i = 0; i < N; i++) cin >> a[i];

    map<int, int> m;
    for(int i = 0; i < N; i++)m[a[i]]++;

    int res = 0;
    for (auto p : m){
        if(p.second - p.first < 0) res += p.second;
        else res += p.second - p.first;
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 5120
c1, c2, c3 = list(input())
c4, c5, c6 = list(input())

flag = True
for x, y in [(c1, c6), (c3, c4), (c2, c5)]:
    if x != y:
        flag = False
if flag:
    print('YES')
else:
    print('NO')

Measured memory_bytes: 3060
#include <stdio.h>
#include <stdlib.h>
 
#define N 8
#define ON 1
#define OFF 0
#define T 1
#define F -1
 
int Search(int);
void Print();
 
int X[N], Y[N], s[N][N], L[2*N-1], R[2*N-1];
 
int main(){
  int i, j, k, r, c;
 
  for(i = 0; i < N; i++){
    X[i] = OFF;
    Y[i] = OFF;
  }
 
  for(i = 0; i < 2*N-1; i++){
    L[i] = OFF;
    R[i] = OFF;
  }
 
  for(i = 0; i < N; i++){
    for(j = 0; j < N; j++){
      s[i][j] = F;
    }
  }
 
  scanf("%d", &k);
  for(i = 0; i < k; i++){
    scanf("%d %d", &r, &c);
    s[r][c] = T;
  }
  Search(0);
  return 0;
}
 

 
void Print(){
  int i, j;
  for(i = 0; i < N; i++){
    for(j = 0; j < N; j++){
      if(s[i][j] == T){
        if(X[i] != j){
          return;
        }
      }
    }
  }
 
  for(i = 0; i < N; i++) {
    for(j = 0; j < N; j++) {
      if(X[i] == j) {
        printf("Q");
      }else{
        printf(".");
      }
    }
    printf("\n");
  }
}

int Search(int p){
  int q;
 
  if(p == N){
    Print();
    return 0;
  }
 
  for(q = 0; q < N; q++){ 
    if(Y[q]==ON || L[p+q]==ON || R[p-q+N-1]==ON){
      continue;
    }
 
    X[p] = q;
    Y[q] = ON;
    L[p+q] = ON;
    R[p-q+N-1] = ON;
 
    Search(p+1);
 
    X[p] = OFF;
    Y[q] = OFF;
    L[p+q] = OFF;
    R[p-q+N-1] = OFF;
  }
   return 0;
}

Measured memory_bytes: 572
def solve():
  n, m = map(int,input().split())
  plst = list(map(int,input().split()))
  pare_inds = [i for i in range(n)]
  
  def find(x):
    p = pare_inds[x]
    if p == x:
      return x
    a = find(p)
    pare_inds[x] = a
    return a
  
  for i in range(m):
    x, y = map(int,input().split())
    x, y = x - 1, y - 1
    r_x, r_y  = find(x), find(y)
    pare_inds[y] = r_x
    pare_inds[r_y] = r_x
  
  ans = 0
  for i in range(n):
    if find(i) == find(plst[i] - 1):
      ans += 1

  print(ans)
solve()

Measured memory_bytes: 14008
#include <iostream>
#include <vector>
#include <cmath>
#define LL long long

using namespace std;

int main() {
	LL a,b,c,k, amb;

	cin >> a >> b >> c >> k;

	amb = a-b;

	cout << amb*((k&1)?-1:1) << endl;

	return 0;
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

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

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

bool isPrime(int n) {

	if (n == 1) return false;
	if (n == 2) return true;

	for (int i = 2; i*i <= n; i++) {
		if (n%i == 0)return false;
	}

	return true;
}

int main() {

	while (true) {
		int a, d, n; cin >> a >> d >> n;

		if (a == 0 && d == 0 && n == 0)return 0;
		int x = a;
		int cnt = 0;


		while (cnt!=n) {
			if (isPrime(x)) {
				cnt++;
			}

			x += d;
		}

		cout << x-d << endl;

		
	}

	return 0;
}


Measured memory_bytes: 3044
#include <algorithm>
#include <cassert>
#include <climits>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

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

const int INF = 1e9;
const long long LINF = 1e18;

pair<int, int> f(int n) {
    int a = n % 10;
    int b;
    while (n != 0) {
        b = n % 10;
        n /= 10;
    }
    return pair<int, int>(a, b);
}

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

    map<pair<int, int>, int> m;
    for (int i = 1; i <= N; i++) {
        m[f(i)]++;
    }

    long long ans = 0;
    for (int i = 1; i <= N; i++) {
        pair<int, int> p = f(i);
        ans += m[pair<int, int>(p.second, p.first)];
    }

    cout << ans << endl;

    return 0;
}


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


int main()
{
    ll s,k;
    cin >> k >> s;
    ll cnt = 0;
    ll r;
    for (int i = 0; i <= k; i++)
    {
        for (int j = 0; j <= k; j++)
        {
            if (s - i - j >= 0 && s - i - j <= k)
            {
                cnt++;
            }
        }
    }
    cout << cnt << endl;




}


Measured memory_bytes: 3568
//
//  main.c
//  t2
//
//  Created by qi on 2016/10/10.
//  Copyright © 2016年 vinchi. All rights reserved.
//

#include <stdio.h>
#include <string.h>

int main(int argc, const char * argv[]) {
    char s[100000];
    int n,a,b,now,nowb;
    scanf("%d %d %d", &n, &a, &b);
    scanf("%s", s);
    now = 0;
    nowb = 0;
    for (int i = 0; i<n; i++) {
        if (s[i] == 'a'){
            if (now < a+b){
                printf("Yes\n");
                now++;
            } else {
                printf("No\n");
            }
        }
        
        if (s[i] == 'b'){
            if ((now < a+b) && (nowb<b)){
                printf("Yes\n");
                now++;
                nowb++;
            } else {
                printf("No\n");
            }
        }
        
        if (s[i] == 'c'){
            printf("No\n");
        }
    }
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
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;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;
// ||

int main() {
  ll a, b; cin >> a >> b;
  if (a == b) cout << "Draw" << endl;
  else if (a == 1) cout << "Alice" << endl;
  else if (b == 1) cout << "Bob" << endl;
  else cout << ((a<b)?"Bob":"Alice") << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        while(true)
        {
            int n = sc.nextInt();
            int x = sc.nextInt();
            if(n == 0 && x == 0) break;
            int ans = 0;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < i; j++) {
                    int y = x - (i + 1 + j + 1);
                    if(y < j+1 && y >0)
                    {
                        ans ++;
                    }
                }
            }
            System.out.println(ans);
        }
        sc.close();
    }
}


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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);	
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll ,ll> 			pll;
typedef pair<ld,ld> 			pld;
typedef unordered_map<ll,ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5+7;
const ll 	MAX7 	= 	1e+7+7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9+7;
const ll 	N 		= 	2*1e6;

/*vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};
*/
// <------------- Declare Variables Here ------------> //

ll T=1;
ll n,x,y,m;
string s,t;
//vll a;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	ll l,r,x;
	cin >> l >> r >> x;
	if(l+x-1 >= r-x+1) {
		for(ll i=l;i<=r;i++) cout<<i<<"\n";
	}
	else {
		for(ll i=l;i<l+x;i++) cout<<i<<"\n";
		for(ll i=r-x+1;i<=r;i++) cout<<i<<"\n";
	}
}

int main() {
	fastio;randomINT;
	//cin>>T;
	while(T--) {
		MAIN();
	}
	return 0;
}



Measured memory_bytes: 3652
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <bits/stdc++.h>
#define ll long long int
using namespace std;


ll foo(ll arr[], int n) {
    int i = 0;
    int j = 0;
    vector<vector<pair<ll, ll>>> dp(n, vector<pair<ll, ll>> (n, {0, 0}));
    while (i < n && j < n) {
        dp[i][j] = {arr[i], 0};
        i++;
        j++;
    }
    for (int k = 1; k < n; k++) {
        i = 0;
        j = k;
        while (i < n && j < n) {
            pair<ll, ll> p1, p2;
            p1.first = arr[j] + dp[i][j-1].second;
            p1.second = dp[i][j-1].first;
            p2.first = arr[i] + dp[i+1][j].second;
            p2.second = dp[i+1][j].first;
            if (p1.first - p1.second > p2.first - p2.second) {
                dp[i][j] = p1;
            } else {
                dp[i][j] = p2;
            }
            i++;
            j++;
        }
    }
    return dp[0][n-1].first - dp[0][n-1].second;
}

int main()
{
    int n;
    cin >> n;
    ll arr[n];
    for (int i = 0; i < n; i++)
        cin >> arr[i];
    cout << foo(arr, n);
    return 0;
}




Measured memory_bytes: 143876
#include<bits/stdc++.h>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
const int MOD = 1000000007;

int main()
{
  string S;
  cin >> S;
  S[5] = ' ';
  S[13] = ' ';
  cout << S << endl;
  return 0;
}



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

int main() {
	int n;
	while (cin>>n&&n!=-1){
		int m;
		if (n <= 10) { m = 1150; }
		else if (n <= 20) { m = 1150 + ((n - 10) * 125); }
		else if (n <= 30) { m = 1150 + 1250 + ((n - 20) * 140); }
		else { m = 1150 + 1250 + 1400 + ((n - 30) * 160); }
		cout << 4280-m << endl;
	}
	return 0;
}

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

int main() {
	int n,d;
	int ans;
	
	cin >> n >> d;
	
	if(n % (2*d + 1) == 0){
		ans = n / (2*d + 1);
	}
	else{
		ans = n / (2*d + 1) + 1;
	}
	
	cout << ans;
	
	return 0;
	
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main()
{
    int num;
    
    cin >> num;
    
    int a;
    int min = 1000000, max = -1000000;
    long long sum = 0;
    
    for(int i=0;i<num;i++)
    {
        cin >> a;
        if(a<min) min = a;
        if(a>max) max = a;
        sum+=a;
    }
    
    cout << min << " " << max << " " << sum << endl;
    
    return 0;
}


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

using namespace std;

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)

typedef struct UnionFind{
	vector<lli> par; //par[i]:iの親番号 par[3] = 2 : 3の親が2
	vector<lli> size;//size[i]:iの大きさ 自分のみのときは1,根っこにsizeを持たせる*/

	UnionFind(int N){/*最初はすべてが根であると初期化*/
		REP(i,0,N){
			par.push_back(i);
			size.push_back(1);
		}
	}

	lli root(lli x){/*データxが属する木の根を再起で得る root(x) = {xの木の根}}*/
		if(par[x] == x)return x;
		return par[x] = root(par[x]);
	}

	void unite(lli x,lli y){/*xとyの併合*/
		lli rx = root(x);
		lli ry = root(y);
		if(rx == ry)return;
		par[rx] = ry; /*xとyの根が同じじゃない: xの根をrxをyの根ryに変更する */
		lli resize = size[rx] + size[ry];
		size[rx] = resize;
		size[ry] = resize;
	}

	bool same(lli x,lli y){
		lli rx = root(x);
		lli ry = root(y);
		return rx == ry;
	}

	lli getSize(lli x){
		lli rx = root(x);
		return size[rx];
	}
};

signed main(){

	lli n,m;
	cin>>n>>m;

	vector<lli> a(m),b(m);
	UnionFind uf(n);

	REP(i,0,m){
		cin>>a[i]>>b[i];
		a[i]--,b[i]--;
	}
	reverse(a.begin(),a.end());
	reverse(b.begin(),b.end());

	vector<lli> ans(m+1);
	ans[0] = n*(n-1)/2;
	REP(i,0,m){
		ans[i+1] = ans[i];
		if(uf.same(a[i],b[i]))continue;
		lli aSize = uf.getSize(a[i]);
		lli bSize = uf.getSize(b[i]);
		if(DEBUG)cout<<"aSize="<<aSize<<" bSize="<<bSize<<endl;
		uf.unite(a[i],b[i]);
		ans[i+1] -= (aSize*bSize);
	}

	for(lli i=m-1;i>=0;i--)cout<<ans[i]<<endl;


	return 0;
}

Measured memory_bytes: 5484
#include <bits/stdc++.h>
using namespace std;
void Main();

using i8  = int8_t;   /* -128 ~ 127 */
using u8  = uint8_t;  /* 0 ~ 255 */
using i16 = int16_t;  /* -32,768 ~ 32,767 */
using u16 = uint16_t; /* 0 ~ 65,535 */
using i32 = int32_t;  /* -2,147,483,648 ~ 2,147,483,647 */
using u32 = uint32_t; /* 0 ~ 4,294,967,295 */
using i64 = int64_t;  /* -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 */
using u64 = uint64_t; /* 0 ~ 18,446,744,073,709,551,615 */
using f32 = float;    /* (-3.4 * 10^38) ~ (3.4 * 10^38) */
using f64 = double;   /* (-1.7 * 10^308) ~ (1.7 * 10^308) */
using f80 = __float80;
template <class T> using Vec = vector<T>;
constexpr i64 INF = 1010000000000000017;
constexpr i64 MOD = 1e9 + 7;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define ALL(v) v.begin(), v.end()
#define YN(a, b, c) ((c)? a : b)
#define GCD(a, b) __gcd(a, b) /* 最大公約数 */
#define LCM(a, b) (i64)(a / (f64)__gcd(a, b) * b) /* 最小公倍数 */

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

void Main() {
    i32 N, K;
    cin >> N >> K;
    Vec<i32> A(N);
    for (i32 i = 0; i < N; i++) cin >> A[i];
    if (K == N) {
        cout << 1 << endl;
        return;
    }
    i32 index = distance(A.begin(), min_element(ALL(A)));
    i32 min_v = 1000001;
    i32 a1 = 0;
    i32 i = 0;
    while (i + K <= index) {
        a1++;
        i += K - 1;
    }
    i += K;
    a1++;
    while (i < N) {
        i += K - 1;
        a1++;
    }
    cout << a1 << endl;
}


Measured memory_bytes: 3652
n, k = gets.split.map(&:to_i)
ary = Array.new
(1..k).each.with_index(1) do |x, i|
  d = gets.to_i
  line = gets.split.map(&:to_i)
  ary = ary.push(*line)
end
puts n - ary.uniq.size


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

int main() {
  int N, K, A;
  cin >> N >> K;
  for (int i = 0; i < N; i++) {
    cin >> A;
  }
  cout << (N - 1 + K - 2) / (K - 1) << endl;
}

Measured memory_bytes: 256
import Control.Monad (replicateM,replicateM_)
import Data.Array (Array,listArray,(!),(//))

main = do
    n <- readLn
    if n == 0 then return () else do
        conv <- readConv n
        m <- readLn
        replicateM_ m (getLine >>= return . (conv !) . head >>= putChar)
        putStrLn ""
        main

readConv :: Int -> IO (Array Char Char)
readConv n = do
    lines <- replicateM n getLine
    let
        conv = map ((\[a,b]->(head a, head b)) . words) lines
    return ((listArray ('0','z') ['0'..'z']) // conv)

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

int N, u, v;
vector<int> nxt[100000];

void dfs( int node, int parent_node, int depth, vector<int>&d ){
	d[node] = depth;
	for ( auto next_node : nxt[node] ){
		if ( next_node != parent_node ){
			dfs( next_node, node, depth+1, d );
		}
	}
}


int main(){
	cin >> N >> u >> v;
	u--;
	v--;

	for ( int i = 0; i < N-1; i++ ){
		int a, b;
		cin >> a >> b;
		a--; b--;
		nxt[a].push_back(b);
		nxt[b].push_back(a);
	}
	
	vector<int> du(N);
	vector<int> dv(N);
	dfs( u, -1, 1, du );
	dfs( v, -1, 1, dv );
	
	
	int max_du = -1;
	int max_dv = -1;
	for ( int i = 0; i < N; i++ ){
		if ( dv[i] > du[i] && max_dv < dv[i] ){
			max_du = du[i];
			max_dv = dv[i];
		}
	}
	
	// vは、開始地点(dv=1)から、最もvから遠い点の1歩手前(dv=max_dv-1)まで移動する
	cout << (max_dv-2) << endl;
	
	return 0;
}



Measured memory_bytes: 11648