akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String judge = "";
		String temp = "";
		int ans = 0;
		for(int i = 0; i < s.length(); i++) {
			temp += s.substring(i,i+1);
			if(temp.equals(judge)) {
				continue;
			}
			else {
				judge = temp;
				temp = "";
				ans++;
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 46912
def main():
    A, B, C, D = map(int, input().split())
    
    takahashi_hp = A
    aoki_hp = C
    
    while True:
        aoki_hp = aoki_hp - B
        if takahashi_hp <= 0:
            out = 'No'
            break

        takahashi_hp = takahashi_hp - D   
        if aoki_hp <= 0:
            out = 'Yes'
            break
    print(out)
main()

Measured memory_bytes: 9168
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL mod = 998244353;
const int maxn = 2e5+100;
LL num[maxn];
LL fac[maxn],Inv[maxn],p[maxn];
LL quick_pow(LL x, LL n, LL p)// 快速幂求x^n mod p 的结果
{
    if(n==0)
        return 1;
    if(n==1)
        return x%p;
    LL ans = 1;
    LL tmp = x%p;
    while(n)
    {
        if(n&1)
        {
            ans = (ans*tmp)%p;
        }
        tmp = tmp*tmp%p;
        n>>=1;
    }
    return ans%p;
}
LL inv(LL b,LL p) //求数 b mod p 的逆元
{
    return quick_pow(b,p-2,p);
}
LL C(LL n,LL m,LL p)//组合数取模
{
    if(m==0|| m== n)
        return 1;
    if(m==1||m==n-1)
        return n%p;
        m = min(m,n-m);
    if(num[m]!=-1)
        return num[m];
    LL up = 1,down = 1;
    for(LL i = n-m+1;i<=n;i++)
        up=(up*i)%p;
    for(LL i = 1;i<=m;i++)
        down=(down*i)%p;
    up%=p;
    down%=p;
    return num[m] = (up*(inv(down,p)%p))%p;
}
LL lucas(LL n,LL m,LL p)//递归lucas函数
{
    if(m==0)
        return 1;
    return lucas(n/p,m/p,p)*C(n%p,m%p,p)%p;
}
LL C1(LL n,LL k)
{
    return fac[n]*Inv[k]%mod*Inv[n-k]%mod;
}
int main()
{
    LL n ,m,k;
    cin >> n >> m >> k;
    LL ans = 0;
    fac[0] = 1;
    for(int i = 1;i<=n;++i)
        fac[i] = 1ll*fac[i-1]*i%mod;
    Inv[n] = inv(fac[n],mod);
    for(int i = n;i>0;--i){
        Inv[i-1] = 1ll*Inv[i]*i%mod;
    }
    p[0] = 1;
    for(int i = 1;i<=n;++i)
        p[i] = p[i-1]*(m-1)%mod;

    for(LL i = 0;i<=k;++i){
        ans = (ans+C1(n-1,i)%mod*p[n-i-1]%mod)%mod;
    }
    ans = (ans*m)%mod;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 8304
#include <iostream>
#include <map>

using namespace std;

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

    map<int, int> mp;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        if (mp[x] > 0) --mp[x];
        else ++mp[x];
    }

    int ans = 0;
    for(auto i : mp){
        if (i.second != 0) ++ans;
    }

    cout << ans << endl;
}

Measured memory_bytes: 4864
N = int(input())

dp = (N+1)*[N]
dp[0]=0

for i in range(0,N+1):
    j = 1
    while i+j <= N:
        dp[i+j]=min(dp[i+j],dp[i]+1)
        j *= 6
    j = 1
    while i+j <= N:
        dp[i+j]=min(dp[i+j],dp[i]+1)
        j *= 9

print(dp[N])

Measured memory_bytes: 68760
//自称高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
    int ans = 0;
	int n, i;
	cin >> n >> i;

    cout << n+1-i << endl;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int H,W;
string S[101];
int D[101][101];
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>H>>W;
	int num=0;
	FOR(y,H) {
		cin>>S[y];
		FOR(x,W) {
			D[y][x]=101010;
			if(S[y][x]=='.') num++;
		}
	}
	queue<int> Q;
	D[0][0]=0;
	Q.push(0);
	while(Q.size()) {
		int cy=Q.front()/100;
		int cx=Q.front()%100;
		Q.pop();
		
		int d[4]={1,0,-1,0};
		FOR(i,4) {
			int ty=cy+d[i];
			int tx=cx+d[i^1];
			if(ty<0 || ty>=H || tx<0|| tx>=W) continue;
			if(S[ty][tx]=='#') continue;
			if(D[ty][tx]<=D[cy][cx]+1) continue;
			D[ty][tx]=D[cy][cx]+1;
			Q.push(ty*100+tx);
		}
	}
	
	if(D[H-1][W-1]>=100000) return _P("-1\n");
	else _P("%d\n",num-D[H-1][W-1]-1);
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 256
def is_valid(s, i, j):
    if s[i][j] == '.':
        return True

    if i > 0 and s[i-1][j] == '#':
        return True

    if j > 0 and s[i][j-1] == '#':
        return True

    if i < len(s) - 1 and s[i+1][j] == '#':
        return True

    if j < len(s[i]) - 1 and s[i][j+1] == '#':
        return True

    return False


h, w = map(int, input().split())

s = []

for i in range(h):
    s.append(input())

for i in range(h):
    for j in range(w):
        if not is_valid(s, i, j):
            print('No')
            exit()

print('Yes')


Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<stdio.h>
#include<stdlib.h>
#include<vector>

using namespace std;
string str;
int x ,y ;
int main() {
  cin>>str;
  int e = -1;
  int w = -1;
  int n = -1;
  int s = -1;
  for(int i=0;i<str.size();i++){
    if(str[i]=='E'){
      x+=1;
      e = 1;
    }
    if(str[i]=='W'){
      x-=1;
      w = 1;
    }
    if(str[i]=='S'){
      y+=1;
      s = 1;
    }
    if(str[i]=='N'){
      y-=1;
      n = 1;
    }
  }
  int we = w + e;
  int ns = n + s;
  if((ns == -2 && we == -2) || (ns == -2 && we ==2 ) || (ns ==2 && we ==-2) || (ns==2 && we==2)){
    cout<<"Yes"<<endl;
  }
  else {
    cout<<"No"<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<tuple>
#define int long long
using namespace std;

signed main() {
	int N;
	cin >> N;
	vector<pair<double,string>> vec(N);
	for(int i = 0;i < N;i++) {
		double A;
		string S;
		cin >> A >> S;
		vec.at(i) = make_pair(A,S);
	}
	double answer = 0;
	for(int i = 0;i < N;i++) {
		if(vec[i].second == "JPY") {
			answer += vec[i].first;
		}
		else if(vec[i].second == "BTC") {
			answer += vec[i].first * 380000.0;
		}
	}
	cout << answer << endl;
}

Measured memory_bytes: 384
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
using namespace std;
const long long mod=998244353;
const long long inf=mod*mod;
const long long d2=500000004;
const double EPS=1e-6;
const double PI=acos(-1.0);
typedef unsigned long long wolf;
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
 
int main(){
	int a;scanf("%d",&a);
	int ret=0;
	for(int i=0;i<40000;i++){
		if(i*i<=a)ret=i*i;
	}
	printf("%d\n",ret);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(int I = int(A); I < int(B); ++I)
#define FORR(I,A,B) for(int I = int((B)-1); I >= int(A); --I)
#define REV(x) (reverse(x.begin(),x.end()))

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

	if(N==1){
		cout << 1 << endl;
		return 0;
	}
	if(N==2){
		cout << 2 << endl;
		return 0;
	}
	int sum = 0,t,sub;
	FOR(i,1,N){
		sum += i;
		t = i;
		if(sum>=N)break;
	}
	sub = sum - N;

	FOR(i,1,t+1){
		if(sub!=i){
			cout << i << endl;
		}
	}


}
// _______  _____  _______  _____  _______ _______ _____ _______ _____ _    _ _______ 
// |       |     | |  |  | |_____] |______    |      |      |      |    \  /  |______ 
// |_____  |_____| |  |  | |       |______    |    __|__    |    __|__   \/   |______ 
//
//  _____   ______  _____   ______  ______ _______ _______ _______ _____ __   _  ______   /
// |_____] |_____/ |     | |  ____ |_____/ |_____| |  |  | |  |  |   |   | \  | |  ____  / 
// |       |    \_ |_____| |_____| |    \_ |     | |  |  | |  |  | __|__ |  \_| |_____| .  
//

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

using namespace std;

int main(){
  long long D,G; cin>>D>>G;
  int ans=100000000;
  vector<int> p(D);
  vector<int> c(D);
  vector<int> SWI(D);
  for(int i=0;i<D;i++) cin>>p[i]>>c[i];
  
  for(int l=0;l<pow(2,D);l++){
	int rem=l;
        for(int k=D-1;k>=0;k--){//2^kの位をSWI[k]
            SWI[k]=rem/(int)pow(2,k);
            rem=rem%(int)pow(2,k);
        }//1つのスイッチの状態完成
    
    //1状態に対しての操作
    int cnt=0;
    long long point=0;
    for(int i=0;i<D;i++){
      if(SWI[i]==0){
    	cnt+=p[i];
      	point+=(i+1)*100*p[i]+c[i];
      }
    }
    if(point<G){
     	int i=D-1;
    	while(point<G && i>=0){
          	int cntp=0;
          if(SWI[i]==1){
        	while(cntp<p[i]-1 && point<G){//1問題
              point+=(i+1)*100;
              cntp++;
            }
          }
          cnt+=cntp;
          i--;
        }
    }
    if(point<G) continue;
    //ここまで
    if(cnt<ans) ans=cnt;
 }

  	printf("%d",ans);
}

Measured memory_bytes: 256
import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.Map.Entry;

public class Main {
	
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner in = new Scanner(file);
		
		Scanner in = new Scanner(System.in);
		
		int a = in.nextInt();
		int b = in.nextInt();
		System.out.println((b - a == in.nextInt() - b) ? "YES" : "NO");
	}
}

Measured memory_bytes: 21588
il = lambda: list(map(int, input().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]

n, k = il()
l = sorted(ils(n, "il()")) + [[10 ** 5+10, 10 ** 5+10]]
cnt = 1
for i, (a, b) in enumerate(l):
    if cnt > k:
        print(l[i-1][0])
        break
    else:
        cnt += b

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

int main()
{
	int N,a,c=0;
	map<int, int> m;
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> a;
		m[a]++;
	}
	
	for (auto x : m)
	{
		if (x.first != x.second)
		{
			if (x.second > x.first)
				c += (x.second - x.first);
			else
				c += x.second;
		}
	}
	
	cout << c;
	
	return 0;
}

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

using namespace std;
using ll = long long;
using ld = long double;
using Vec = vector<int>;

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}


int main(){

string s;
cin>>s;
if(s=="SSS"){
    cout<<0<<endl;
}
else if(s=="SSR" || s=="SRS"||s=="RSS"||s=="RSR"){
    cout<<1<<endl;
}
else if(s=="RRR"){
    cout<<3<<endl;
}
else{
    cout<<2<<endl;
}



}

Measured memory_bytes: 3620
// Sakhiya07 - Yagnik Sakhiya
 
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
#define pll pair<int,int>
 
#define mp make_pair
#define bp __builtin_popcountll
#define MOD  1000000007
const int N = 500005;

#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL));

void solve()
{
     string s;
     cin >> s;
     if(s[2]==s[3] && s[4]==s[5]) 
     {
          cout<<"Yes";
     }      
     else
     {
          cout<<"No\n";
     }
}

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

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

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


signed main() {
    string S;
    cin >> S;
    if (S == "AAA" || S == "BBB") {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<int,int> ii;
typedef pair<ii,int> iii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
#define eb emplace_back
#ifdef cold66
#define debug(...) do{\
    fprintf(stderr,"LINE %d: (%s) = ",__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<", ";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // cold66
//}
template<class T> inline bool chkmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, true : false; }

const ll MAXn=2e5+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=0x3f3f3f3f;

ll mul(ll a,ll b){
    return a*b%MOD;
}
ll add(ll a,ll b){
    ll ret = a + b;
    if (ret >= MOD) ret -= MOD;
    return ret;
}
ll fpow(ll a,ll b){
    ll ret = 1;
    while (b) {
        if (b&1) ret = mul(ret,a);
        a = mul(a,a);
        b >>= 1;
    }
    return ret;
}
ll d[MAXn];
int main(){
    IOS();
    ll n;
    cin >> n;
    REP1 (i,n) cin >> d[i];
    sort(d+1,d+n+1,greater<ll>());
    ll sum = 0;
    REP1 (i,n) {
        sum = add(sum,mul(d[i],i+1));
    }
    cout << mul(fpow(4,n-1),sum) << endl;
}


Measured memory_bytes: 5140
s = input()
n = len(s)

c2 = s[:(n-1)//2]
c3 = s[(n+1)//2:]

flg = True

if s != s[::-1]:
    flg = False
if c2 != c2[::-1]:
    flg = False
if c3 != c3[::-1]:
    flg = False
    
    
print('Yes' if flg else 'No')


Measured memory_bytes: 3060
#今Xにいる、K回 D移動する
[X, K, D] = [int(i) for i in input().split()]
#正負で答え変化しないので、正に変える
X = abs(X)
if X - K*D > 0:
#原点に到達しないとき
    print(X-K*D)
#原点に到達するとき
else:
    #往復始める正の位置を求める
    time = int(X/D)
    start = X - D * time
    #残り移動回数を計算
    time_re = K - time
    #残り回数の偶奇で場合分け
    if time_re % 2 == 0:
        print(start)
    else:
        print(abs(start-D))

Measured memory_bytes: 9148
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int main() {
	int K;
	cin >> K;
	string S;
	cin >> S;

	for(int i=0; i<K && i<S.size(); i++) {
		cout << S.at(i);
	}
	if(K < S.size()) {
		cout << "...";
	}

	return 0;
}

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

public class Main {
    static long mod = (long) 1e9 + 7;
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        long r1 = sc.nextLong(); long c1 = sc.nextLong(); long r2 = sc.nextLong(); long c2 = sc.nextLong();
        initFac(r2 + c2 + 3);
        long plus = (nck((int) (r2 + c2 + 2), (int) r2 + 1) + nck((int) (r1 + c1), (int) r1)) % mod;
        long minus = (nck((int) (r2 + c1 + 1), (int) r2 + 1) + nck((int) (r1 + c2 + 1), (int) r1)) % mod;
        long ans = (plus - minus) % mod;
        if (ans < 0) ans += mod;
        out.println(ans);
        out.close();
    }

    static long[] fac;

    static void initFac(long n) {
        fac = new long[(int) n + 1];
        fac[0] = 1;
        for (int i = 1; i <= n; i++) {
            fac[i] = (fac[i - 1]  * i) % mod;
        }
    }

    static long exponentiation(long base, long exp)
    {
        long t = 1L;
        while (exp > 0) {

            // for cases where exponent
            // is not an even value
            if (exp % 2 != 0)
                t = (t * base) % mod;

            base = (base * base) % mod;
            exp /= 2;
        }
        return t % mod;
    }

    static long nck(int n, int k) {
        if (n < k)
            return 0;
        long den = inv((int) (fac[k] * fac[n - k] % mod));
        return (fac[n] * den) % mod;
    }

    static long pow(long b, long e) {
        long ans = 1;
        while (e > 0) {
            if (e % 2 == 1)
                ans = ans * b % mod;
            e >>= 1;
            b = b * b % mod;
        }
        return ans;
    }

    static long inv(int x) {
        return pow(x, mod - 2);
    }



    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }


    }

}

Measured memory_bytes: 48072
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    double a = sc.nextDouble();
    double b = sc.nextDouble();
    double x = sc.nextDouble();
    sc.close();
    double fullV = a * a * b;
    double degree = 180 / Math.PI;
    if (x < fullV / 2) {
      double theta = Math.atan(a * b * b / (2.0 * x));
      System.out.println(theta * degree);
    } else {
      double theta = Math.atan(2.0 * (a * a * b - x) / Math.pow(a, 3.0));
      System.out.println(theta * degree);
    }
  }
}

Measured memory_bytes: 23120
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		 Scanner sc = new Scanner(System.in);
		 int x = sc.nextInt();
		 int t = sc.nextInt();

		 int a = 0;

		 if(x>t){
		 a = x - t;
		 }else{
			 a = 0;
		 }

		 System.out.println(a);

	}

}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>


using namespace std;
#define PI acos(-1)

int main()
{
	int S;
	cin >> S;
	int a =S%10;
	switch(S%10){
	    case 0:
	    case 1:
	    case 6:
	    case 8:
	    cout<<"pon"<<endl;
	    break;
	    
	    case 2:
	    case 4:
	    case 5:
	    case 7:
	    case 9:
	    cout<<"hon"<<endl;
	    break;
	    case 3:
	    cout<<"bon"<<endl;
	    break;
	}

}



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

main(){

  ll n,a,b;
  cin>>n>>a>>b;
  if(a==b)puts("1");
  else if(a>b)puts("0");
  else if(n==1&&a!=b)puts("0");
  else {
    ll mx=b*(n-1)+a;
    ll mn=a*(n-1)+b;
    ll ans=mx-mn+1;
    cout<<(ans)<<endl;
  }

}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string.h>
#include <stdlib.h>

using namespace std;

int main(void){
    char a[] = "YAKI";
    char S[11];
    
    cin >> S;
    
    if(strncmp(a, S, 4) == 0)
        cout << "Yes" << endl;
    
    else
        cout << "No" << endl;
    return 0;
        }


Measured memory_bytes: 256
PROGRAM eityOne
      IMPLICIT NONE
      INTEGER :: N
      
      LOGICAL :: flag
      INTEGER :: a, b
      
      READ*,N
      
      flag = .false.
      
      
      outer:DO a = 1,9
        DO b = 1,9
          IF( a*b==N )THEN
            flag = .true.
            EXIT outer
          END IF
        END DO
      END DO outer
      
      if( flag )THEN
        print*,'Yes'
      ELSE
        print*,'No'
      END IF
      
      
      
      
      END PROGRAM

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

int main() {
    int N;cin >> N;
    if(N/10==9 || N%10==9)
    cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
const ll mod = 1e9+7;
void solve(){
    int n,x,t;
    cin>>n>>x>>t;
    int b = (n+x-1)/x;
    cout<<b*t<<endl;
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
//    cin>>t;
    while(t--)solve();
    return 0;
}


Measured memory_bytes: 3636
//Pantyhose(black) + glasses = infinity

#include <bits/stdc++.h>
using namespace std;
 
#define debug(x) cerr << #x << " = " << x << '\n';
#define BP() cerr << "OK!\n";
#define PR(A, n) {cerr << #A << " = "; for (int _=1; _<=n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define PR0(A, n) {cerr << #A << " = "; for (int _=0; _<n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define FILE_NAME "data"

const int MOD = 1000000007;

int main() {
	#ifdef GLASSES_GIRL
		freopen(FILE_NAME".in", "r", stdin);
		freopen(FILE_NAME".out", "w", stdout);
	#endif
	ios::sync_with_stdio(0); cin.tie(0);

	int n;
	string s;

	cin >> n >> s;

	int64_t res = 1;
	for (char c='a'; c<='z'; ++c)
		res = res * (count(s.begin(), s.end(), c)+1) % MOD;

	cout << (res - 1 + MOD) % MOD;
}

Measured memory_bytes: 512
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <tuple>
#include <stdlib.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
#define PI 3.14159265358979
typedef long long int ll;
const int inf=1001001001;
ll absc(ll a,ll b){return (a-b>0?a-b:b-a);
}
ll mini(ll a,ll b){return (a>b?b:a);}
int main()
{
    ll m,b,c,n,sum=0,ans;
    string s,t;
    cin>>n>>m;
    ans=n;
    ans=mini(n%m,ans);
    ans=mini(ans,absc(m,n%m));
    ans=mini(absc(m,absc((n%m+n),m)),ans);
    cout<<ans;
}


Measured memory_bytes: 256
import math

n = int(input())
ab = []
for i in range(n):
  ab.append(tuple(map(int,input().split())))
MOD = 1000000007

d = {}
zero = 0
for a,b in ab:
  if a == 0 and b == 0:
    zero += 1
    continue
  g = math.gcd(a,b)
  a //= g
  b //= g
  if b < 0:
    a,b = -a,-b
  elif a < 0 and b == 0:
    a = -a
  rot90 = False
  if a <= 0:
    a,b = b,-a
    rot90 = True
  if (a,b) in d:
    if rot90:
      d[(a,b)][1] += 1
    else:
      d[(a,b)][0] += 1
  else:
    if rot90:
      d[(a,b)] = [0,1]
    else:
      d[(a,b)] = [1,0]
#print(d)

ans = 1
for k,v in d.items():
  tmpans = pow(2,v[0],MOD)+pow(2,v[1],MOD)-1
  tmpans %= MOD
  ans *= tmpans
ans -= 1
ans += zero
print(ans%MOD)

Measured memory_bytes: 142252
# ABC134d
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())
a = [-1]
a.extend(list(map(int, input().split())))
ans = [0]*(n+1)


for i in range(n, 0, -1):
    j = 1
    su = 0
    while (i * j <= n):
        su += ans[i * j]
        j += 1
    # print(str(i)+"は"+str(su))
    if (su % 2 == a[i]):
        # print("なので"+str(i)+"を0")
        ans[i] = 0
    else:
        # print("なので"+str(i)+"を1")
        ans[i] = 1

# print(ans)

s = ""
c = 0
for i in range(n+1):
    if (ans[i] == 1):
        c += 1
        s += str(i)+" "
print(c)
if(c != 0):
    print(s)

Measured memory_bytes: 9104
#include <bits/stdc++.h>
using namespace std;
#define lli long long
lli a[200005];
lli p[200005];
lli s[200005];

int main() {
	int n;
	cin>>n;
	
	
	for(int i=1;i<=n;i++){
	    cin>>a[i];
	    a[i]=a[i]-i;
	}
	
	
	sort(a+1,a+n+1);
	
	//for(int i=1;i<=n;i++) cout<<a[i]<<" ";
	//cout<<endl;
	p[0]=0;
	for(int i=1;i<=n;i++) p[i]=p[i-1]+a[i];
	
	
	s[n+1]=0;
	
	for(int i=n;i>=1;i--) s[i]=s[i+1]+a[i];
	
//	for(int i=1;i<=n;i++) cout<<p[i]<<" "<<s[i]<<endl;
	lli ans=(lli)(1e17+100);
	
	for(int i=1;i<=n;i++){
	    if(i==1){
	        lli sum = abs(s[i+1] - 1LL*(n-i)*a[i]);
	        ans=min(ans,sum);
	    }
	    else if(i==n){
	        lli sum = abs(p[i-1] - 1LL*(i-1)*a[i]);
	        ans=min(ans,sum);
	    }
	    else{
	        lli sum = abs(p[i-1] - 1LL*(i-1)*a[i]) + abs(s[i+1] - 1LL*(n-i)*(a[i]));
	        ans=min(ans,sum);
	    }
	    //cout<<ans<<endl;
	}
	
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 4992
def main():
    N, M = map(int, input().split())

    f(N, M)


def f(N, M):
    """
    カードAおよび周り8方向を裏返す
    すべてのカードについて行う
    うらの数(1)の枚数

    1 <= N,M <= 10^9
        シミュレート: TLE
    """
    ans = 0
    if N == 1 and M == 1:
        ans = 1
    elif N == 2 or M == 2:
        ans = 0
    elif N >= 3 and M >= 3:
        ans = (N-2) * (M-2)
    else:
        # 3>,1 or 1,3>
        ans = max(N, M) - 2

    print(ans)


if __name__ == '__main__':
    main()


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


int main() {
  int n,r;
  
  cin >> n >> r;
  
  int total = 0;
  
  if(n>10)
    cout << r;
  
  else{
    total = r+(100*(10-n));
    cout << total;
  }
    
   
}

Measured memory_bytes: 256
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]


W,a,b = map(int, input().split())

if (b+W < a):
    print(a-(b+W))
elif (a+W < b):
    print(b-(a+W))
else:
    print(0)


Measured memory_bytes: 9168
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long all = 1, odd = 1;
            for (int i = 0; i < n; ++i) {
                int x = in.nextInt();
                int cntOdd = 0;
                for (int val = x - 1; val <= x + 1; ++val) {
                    if (val % 2 != 0) {
                        cntOdd++;
                    }
                }
                all *= 3;
                odd *= cntOdd;
            }
            out.println(all - odd);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}



Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main() {
    int N; cin >> N;
    set<int> A;
    REP(i, 0, N) {
        int a; cin >> a;
        A.insert(a);
    }
    if (N == A.size()) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
#define INF 1000000000

using namespace std;

int n=0;
int d[2001], x=0,y=0;
vector<int> g[2001];
unordered_map<int, int> Map;

int main()
{
	scanf("%d%d%d", &n, &x, &y);
	for (int i=0; i<n-1; i++)
	{
		g[i].push_back(i+1);
		g[i+1].push_back(i);	
	}
	x--;
	y--;
	g[x].push_back(y);
	g[y].push_back(x);
	for (int s=0; s<n; s++)
	{
		set<pair<int, int> > Set;	
		for (int i=0; i<n; i++)
			d[i] = INF;	
		d[s] = 0;
		Set.insert({d[s], s});
		while (!Set.empty())
		{
			int v = (*Set.begin()).second;
			int dd = (*Set.begin()).first;
			Set.erase(Set.begin());
			for (int i=0; i<g[v].size(); i++)
			{
				int to = g[v][i];
				if (d[to]>dd+1)
				{
					Set.erase({d[to], to});
					d[to] = dd+1;
					Set.insert({d[to], to});
				}
			}
		}
		for (int i=0; i<n; i++)
		{
			Map[d[i]]++;
		}
	}
	for (int i=1; i<n; i++)
		printf("%d\n", Map[i]/2);
	return 0;
}


Measured memory_bytes: 512
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
using namespace std;
typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vpii; typedef long long ll;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }

ll sq(int x) { return (ll)x * x; }

int main() {
	int N;
	scanf("%d", &N);
	vi f(N), a(N), t(N), x(N), y(N);
	rep(i, N)
		scanf("%d%d%d%d%d", &f[i], &a[i], &t[i], &x[i], &y[i]);
	pair<ll,int> ans[2] = { mp(-1, -1), mp(-1, -1) };
	rep(i, N-1) if(t[i] == t[i+1] && a[i] != a[i+1])
		amax(ans[t[i]], mp(sq(x[i] - x[i+1]) + sq(y[i] - y[i+1]), -(f[i+1] - f[i])));
	rep(k, 2) {
		if(ans[k].first == -1)
			puts("-1 -1");
		else
			printf("%.10f %.10f\n", sqrt(ans[k].first * 1.), -ans[k].second / 60.);
	}
	return 0;
}

Measured memory_bytes: 1228
from collections import defaultdict

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

hasOne = defaultdict(bool)
E = []

for a in A:
  if not hasOne[a]:
    hasOne[a] = True
  else:
    E.append(a)
    hasOne[a] = False

E.sort(reverse=True)

if len(E) < 2:
  print(0)
else:
  print(E[0] * E[1])


Measured memory_bytes: 18600
while True:
    n = int(input())
    if n ==0:
        break
    else:
        list0=[]
        i=0
        for i in range(n):
            list0.append(int(input()))    
        list0.remove(max(list0))
        list0.remove(min(list0))
        s=sum(list0)
        a = n-2
        print(s//a)
        i=i+1



Measured memory_bytes: 5592
#include <iostream>

int main()
{

    int a, b, c, d;

    std::cin >> a >> b >> c;

    if (a == b)
    {
        d = c;
    }
    else if (a == c)
    {
        d = b;
    }
    else
    {
        d = a;
    }

    std::cout << d << std::endl;

    return 0;
}

Measured memory_bytes: 256
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

S = input()
print("Second" if (len(S) % 2 == 0) ^ (S[0] == S[-1]) else "First")

Measured memory_bytes: 4080
#include<stdio.h>

int main(){
	long n,a[100000],x,i;
	long long eat;
	scanf("%ld %ld",&n,&x);
	eat=0LL;
	for(i=0;i<n;i++){
		scanf("%ld",&a[i]);
		if(i>0){
			if(i==1){
				if(a[i]+a[i-1]>x){
					eat+=a[i]+a[i-1]-x;
					a[i]-=a[i]+a[i-1]-x;
					if(a[i]<0){
						a[i-1]+=a[i];
						a[i]=0;
					}
				}
			}else{
				if(a[i]+a[i-1]>x){
					eat+=a[i]+a[i-1]-x;
					a[i]-=(a[i]+a[i-1]-x);
				}
			}
		}
	}
	printf("%lld\n",eat);
	return 0;
}

Measured memory_bytes: 896
#include <stdio.h>

int main(void)
{
        int n,i,c;

        scanf("%d",&n);

        char s[n];

        scanf("%s",s);

        c=1;
        for(i=0;i<n-1;i++){
                if(s[i]!=s[i+1]) c++;
        }

        printf("\n");
        printf("%d",c);
        return 0;
}


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

typedef long long ll;

const int maxn = 1000000 + 10;
const ll INF = 100000000000;

int a[maxn];

ll Abs(ll x)
{
	return x > 0 ? x : -x;
}

int main()
{
	ll x, y;
	y = 0;
	x = 0;
	ll n;
	cin >> n;
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		y += a[i];
	}

	ll min = INF;
	
	for (int i = 0; i < n - 1; i++) {
		x += a[i];
		y -= a[i];
		if (Abs(x - y) < min) min = Abs(x - y);
	}

	cout << min;

	return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
typedef vector<vll> vvll;

#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define no cout<<"No"<<endl
#define NO cout<<"NO"<<endl
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

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

  ll h,w,n,sr,sc;
  cin>>h>>w>>n>>sr>>sc;
  sr--;
  sc--;

  string s,t;
  cin>>s>>t;

  pll height,width;
  height=pll(0,h-1);
  width=pll(0,w-1);

  for(ll i=n-1; i>=0; i--){
    if(t[i]=='L'){
      width.SE=min(width.SE+1,w-1);
    }
    if(t[i]=='R'){
      width.FI=max(width.FI-1,0LL);
    }
    if(t[i]=='U'){
      height.SE=min(height.SE+1,h-1);
    }
    if(t[i]=='D'){
      height.FI=max(height.FI-1,0LL);
    }


    if(s[i]=='L'){
      width.FI+=1;
    }
    if(s[i]=='R'){
      width.SE-=1;
    }
    if(s[i]=='U'){
      height.FI+=1;
    }
    if(s[i]=='D'){
      height.SE-=1;
    }


    if(width.FI>width.SE || height.FI>height.SE){
      NO;
      return 0;
    }

  }



  if((width.FI<=sc && sc<=width.SE) && (height.FI<=sr && sr<=height.SE))
    YES;
  else
    NO;
}



Measured memory_bytes: 920
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,s,f) for(int i=s;i<f;i++)
#define INF 1000000000000000000
#define MOD 1000000007
#define endl "\n"
#define fcout cout<<fixed<<setprecision(15)
typedef pair<int, int> P;
struct edge { int to, cost; };

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

bool prime(int n) {
    for (int i = 2; i <= sqrt(n); i++) {
        if (n % i == 0)return false;
    }
    return n != 1;
}
int gcd(int x, int y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
int lcm(int x, int y) {
return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
    if (p == 0) return 1;
    if (p % 2 == 0) {
        int t = mod_pow(n, p / 2, m);
        return (t * t) % m;
    }
    return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = extGCD(b, a % b, y, x);
    y -= a / b * x;
    return d;
}
int modinv(int a, int m) {
    int b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
int digit(int x) {
    int cnt = 0;
    while (x > 0) {
        cnt += x % 10;
        x /= 10;
    }
    return cnt;
}
int read() {
    int tmp;
    cin >> tmp;
    return tmp;
}
int xor128() {
    static int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    int t = (x xor (x << 11));
    x = y; y = z; z = w;
    return (w = (w xor (w >> 19)) xor (t xor (t >> 8)));
}
map<int, int> factaring(int x) {
    map<int, int>ans;
    int now = 2;
    while (now * now <= x) {
        if (x % now == 0) {
            x /= now;
            ans[now]++;
        }
        else now++;
    }
    if (x != 1) ans[x]++;
    return ans;
}
int comb(int n, int k, int mod) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    k = min(k, n - k);
    int x = 1, y = 1;
    rep(i, k) {
        y *= i + 1;
        y %= mod;
    }
    for (int i = n - k + 1; i <= n; i++) {
        x *= i;
        x %= mod;
    }
    return x * modinv(y, mod) % mod;
}

signed main() {
    //srand((unsigned)time(NULL));

    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n;
    int p[10], q[10];
    int a, b;
    vector<int>vec;

    cin >> n;
    rep(i, n) cin >> p[i];
    rep(i, n) cin >> q[i];

    rep(i, n) vec.push_back(i + 1);

    int cnt = 1;

    do {
        bool x = true, y = true;
        rep(i, n) {
            if (vec[i] != p[i]) x = false;
            if (vec[i] != q[i]) y = false;
        }
        if (x) a = cnt;
        if (y) b = cnt;
        cnt++;
    } while (next_permutation(vec.begin(), vec.end()));
    cout << abs(a - b) << endl;

    return 0;
}


Measured memory_bytes: 256
A,B,K=map(int,input().split())
s=set()
for i in range(A,min(A+K,B+1)):
    s.add(i)
for i in range(max(B-K+1,A),B+1):
    s.add(i)
li=sorted(s)
for i in li:
    print(i)

Measured memory_bytes: 3060
#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 1000000002486618624LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);

  long long K, a[55];

  std::cin >> K;

  for (long long N = 50; N >= 1; N --) {
    std::vector<long long> n(N, K / N);

    for (int i = 0; i < K % N; i ++)
      n[i] ++;

    for (int i = 0; i < N; i ++)
      a[i] = n[i] * N - (K - n[i]) + N - 1;

    std::cout << N << std::endl;

    for (int i = 0; i < N; i ++)
      std::cout << a[i] << ' ';
    std::cout << std::endl;

    break;
  }

  return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace csharp
{
    class Program
    {

        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());

            var nums = Console.ReadLine().Split().Select(s => int.Parse(s));

            var max = nums.Max();
            var min = nums.Min();

            Console.WriteLine(max - min);
        }
    }
}


Measured memory_bytes: 13396
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<numeric>

using namespace std;

int main(){
    long long a, b, k;
    cin >> a >> b >> k;

    if(k <= a)
        cout << a - k << " " << b << endl;
    else if (k <= a+b)
        cout << 0 << " " << b - (k - a) << endl;
    else cout << 0 << " " << 0;
}

Measured memory_bytes: 3632
//-------All power is within you,you can do Anything and Everything.---------//
 
    #include <bits/stdc++.h>
    using namespace std;
  
//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ M $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//
 
    #define pb push_back
    #define MP make_pair
    #define F first
    #define S second
    #define int long long
    #define fo(i,a,b) for(int i=a;i<b;i++)
    #define rfo(i,b,a) for(int i=b;i>=a;i--)
    #define deb(x) cout<<#x<<" "<<x<<endl;
    #define mem( a, val ) memset(a, val, sizeof( a ) )
    #define deci( x ) cout<<fixed<<setprecision( x );
    #define bitcount( x ) __builtin_popcountll( x )
 
    
    typedef vector<int> vi;
    typedef pair<int,int> pi; 
    
    const int MOD =  1000000007 ;
    const int MAX = 2e6 + 7;
    const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
    const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
 
//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ V $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//  
    
    int i,j,k,t,n,q,l,r,mid;
    
//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ F $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//
    
    int cnt,x;
    priority_queue<int,vector<int>,greater<int> > pq;
    void solve()
    {
    	cin>>n;
    	fo(i,0,n)
    	{
    		cin>>x;
    		pq.push(x);
    		// deb(pq.top())
    		if(pq.top()<x)
    			cnt++;
    	}
        cout<<n-cnt<<endl;
    }
    
//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//
//                          GAME STARTS FROM HERE                            //
 
    int32_t main() 
      {
        
        // int start,stop=clock();
        // cout<<"time:"<<(stop-start)/double(CLOCKS_PER_SEC)*1000<<endl;
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);
        
        // cin>>t;while(t--)
        solve();
        
      return 0;
      }

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

int main() {
  int n,k;
  cin >> n >> k;
  int f=0;
    
  for(int i=0; i<n ;i++){
    int x;
    cin >> x;
    if(k<2*x)
      f +=2*(k-x);
    else
      f +=2*x;
  }
  
  cout << f << endl;
}

Measured memory_bytes: 256
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
#from math import gcd
from fractions import gcd
n,m = iim()
s = input()
t = input()
num = gcd(n,m)
lcm = n*m//num
print(lcm if s[::n//num] == t[::m//num] else -1)


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

public class Main {
    public static void main(String[] args) {
        FastScanner scanner = new FastScanner();
        PrintWriter out = new PrintWriter(System.out,false);
        int n = scanner.nextInt();
        PriorityQueue<Double> queue = new PriorityQueue<>();
        for(int i = 0; i < n; i++) {
            queue.offer(scanner.nextDouble());
        }
        while(queue.size() > 1) {
            double min = queue.poll();
            queue.offer((min + queue.poll())/2);
        }
        out.println(queue.peek());
        out.flush();
    }
    
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
        
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


Measured memory_bytes: 22996
n=int(input())
arr=[[int(input()),i+1] for i in range(n)]
arr=sorted(arr,key=lambda x:x[0])
for i in range(n):
  arr[i].append(i+1)
ans=0
for val,pos1,pos2 in arr:
  if abs(pos1-pos2)%2==1:
    ans+=1
  else:
    continue
print(ans//2)

Measured memory_bytes: 26292
#include<iostream>
#include<cstdio>
using namespace std;
const int N=15;
const int MOD=998244353;
int n,m;
long long ksm(long long a,long long b)
{
	long long res=1;
	while(b)
	{
		if(b&1) res=res*a%MOD;
		a=a*a%MOD,b>>=1;
	}
	return res;
}
long long fac[N],inv[N];
long long Pw[N];
void init(int n=10)
{
	fac[0]=1;
	for(int i=1;i<=n;i++)
		fac[i]=fac[i-1]*i%MOD;
	inv[n]=ksm(fac[n],MOD-2);
	for(int i=n;i>=1;i--)
		inv[i-1]=inv[i]*i%MOD;
	Pw[0]=1;
	for(int i=1;i<=n;i++)
		Pw[i]=Pw[i-1]*2%MOD;
	return;
}
long long C(int n,int m)
{
	if(m>n) return 0;
	else return fac[n]*inv[m]%MOD*inv[n-m]%MOD;
}
int r[N],c[N];
char s[N][N];
long long f[N][N][3],g[N][N][3];
int main()
{
	init();
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
		scanf("%s",s[i]);
	for(int i=0;i<n;i++)
		for(int j=0;j<m;j++)
			 if(s[i][j]=='.') r[i]|=1<<j,c[j]|=1<<i;
	for(int j=1;j<=m;j++)
		g[n][j][2]=C(m,j)*Pw[m-j]%MOD;
	long long ans=Pw[m];
	for(int i=n;i>=1;i--)
		for(int j=m;j>=1;j--)
		{
			g[i][j][0]=(g[i][j][1]+g[i][j][2])%MOD;
			for(int k=1;k<i;k++)
			{
				int d=i-k;
				f[k][j][1]=(f[k][j][1]+C(i,d)*(g[i][j][2]*2+g[i][j][1])%MOD)%MOD;
				f[k][j][2]=(f[k][j][2]+C(i,d)*(Pw[d]-2)%MOD*g[i][j][2]%MOD)%MOD;
			}
			ans=(ans+g[i][j][2]*(Pw[i]-2)%MOD)%MOD;
			f[i][j][0]=(f[i][j][1]+f[i][j][2])%MOD;
			for(int k=1;k<j;k++)
			{
				int d=j-k;
				g[i][k][1]=(g[i][k][1]+C(j,d)*(f[i][j][2]*2+f[i][j][1])%MOD)%MOD;
				g[i][k][2]=(g[i][k][2]+C(j,d)*(Pw[d]-2)%MOD*f[i][j][2]%MOD)%MOD;
			}
			ans=(ans+f[i][j][2]*(Pw[j]-2)%MOD)%MOD;
		}
	for(int i=1;i<(1<<n);i++)
		for(int j=1;j<(1<<m);j++)
		{
			bool flag=true;
			for(int k=0;k<n;k++)
				if(i&(1<<k))
				{
					int w=r[k]&j;
					if(w==j||w==0)
					{
						flag=false;
						break;
					}
				}
			if(!flag) continue;
			for(int k=0;k<m;k++)
				if(j&(1<<k))
				{
					int w=c[k]&i;
					if(w==i||w==0)
					{
						flag=false;
						break;
					}
				}
			if(!flag) continue;
			int x=__builtin_popcount(i),y=__builtin_popcount(j);
			ans=(ans+(f[x][y][0]+g[x][y][0])%MOD*ksm(C(n,x),MOD-2)%MOD*ksm(C(m,y),MOD-2)%MOD)%MOD;
		}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 3800