akhauriyash/Code-Regression huggingface dataset:
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		sc.nextLine();
		String[] info=sc.nextLine().split(" ");
		BigDecimal t=new BigDecimal(info[0]);
		BigDecimal a=new BigDecimal(info[1]);

		List<BigDecimal> input=Arrays.asList(sc.nextLine().split(" "))
				.stream()
				.map(s->new BigDecimal(s)
						.multiply(new BigDecimal("-0.006"))
						.add(t)
						.subtract(a)
						.abs())
				.collect(Collectors.toList());
		System.out.println(input.indexOf(Collections.min(input))+1);
	}
}

Measured memory_bytes: 27212
n, q = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n - 1)]
px = [list(map(int, input().split())) for _ in range(q)]
 
neigh = {}
 
scores = [0] * n
 
for i in range(q) :
    scores[px[i][0] - 1] += px[i][1]
#print(*scores) 
for i in range(n - 1) :
    neigh.setdefault(ab[i][0], []).append(ab[i][1])
#print(neigh)

sortKey = sorted(neigh.keys())
 
for k in sortKey :
    for e in neigh[k]:
        scores[e-1]+=scores[k-1]
 
print(*scores)

Measured memory_bytes: 140068
#include <stdio.h>
#include <math.h>
int main(){
    double a,b,t;
    scanf("%lf%lf%lf",&a,&b,&t);
    printf("%lf\n%lf\n%lf\n",(sin(t*3.14159265359/180)*a*b)/2,a+b+sqrt(a*a+b*b-2*a*b*cos(t*3.14159265359/180)),sin(t*3.14159265359/180)*b);
}

Measured memory_bytes: 2972
#include<bits/stdc++.h>
using namespace std;
#define faster_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;
#define bug(a)       cerr << #a << " : " << a << endl;
template<class T>void ExEuclid(T n, T m, T &a, T &b, T &gcd){if(m==0){gcd=n;a=1;b=0;return;}ExEuclid(m,n%m,a,b,gcd);T x=a;a=b;b=x-(n/m)*a;}
template<class T>T gcd(T n, T m){if(m==0){return n;}gcd(m,n%m);}
template<class T>T lcm(T n, T m){return (n*m)/gcd(n,m);}
template<class T>string to_string(T n){string s="";while(n)s+=((n%10)+'0'),n/=10;reverse(s.begin(),s.end());return s;}
template<class T>ll to_int(T s){ll num=0,power=0;for(int i=s.size()-1; i>=0; i--)num+=(pow(10.0,power++)*(s[i]-'0'));return num;}
template<class T>bool is_mod(T n, T m){if(n%m==0)return true;return false;}
template<class T>bool is_upper(T s){for(int i=0; i<s.size(); i++)if(s[i]>90 || s[i]<65)return false;return true;}
template<class T>bool is_lower(T s){for(int i=0; i<s.size(); i++)if(s[i]>122 || s[i]<97)return false;return true;}
template<class T>T mod(T n, T m){return ((n%m)+m)%m;}
template<class T>T Big_mod(T base, T power, T MOD){
    if(power==1)return base;
    if(power & 1)return ((base%MOD)*(Big_mod(base,power-1,MOD))%MOD)%MOD;
    else {T temp=(Big_mod(base,power>>1,MOD));return ((temp%MOD)*(temp%MOD))%MOD;}
}



int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    faster_io;
    ll a,b,t;
    cin>>a>>b>>t;
    cout<<(b*(floor(double(t)/a)))<<endl;


    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

int main()
{
	long long int a[10], b[10];
	std::cin >> a[0] >> a[1] >> a[2] >> a[3];
	b[0] = a[0] * 8;
	b[1] = a[1] * 4;
	b[2] = a[2] * 2;
	b[3] = a[3];
	
	std::sort(b, b + 4);
	
	long long int n;
	std::cin >> n;
	
	long long int result = 0;
	
	result += b[0] * (n / 2);
	if (n % 2 == 0)
		n = 0;
	else
		n = 1;
	
	b[0] = a[0] * 4;
	b[1] = a[1] * 2;
	b[2] = a[2];
	
	std::sort(b, b + 3);

	result += b[0] * n;
	
	std::cout << result;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
using ll=long long;
using P=pair<ll,ll>;
using PP=tuple<ll,ll,ll>;
using S=multiset<ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
void decimal(int x){cout<<fixed<<setprecision(x);}
ll GCD(ll a,ll b){if(b==0) return a; return GCD(b,a%b);}
ll LCM(ll a,ll b){return(a/GCD(a,b))*(b/GCD(a,b))*GCD(a,b);}
ll POW(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*POW(a,b-1)%mod;ll k=POW(a,b/2);return k*k%mod;}
vi calc(ll x){vi res;while(x>0){res.eb(x%10);x/=10;}reverse(all(res));return res;}

void solve() {
  ll n,k;
  cin>>n>>k;
  vi h(n);
  rep(i,n) cin>>h[i];
  sort(all(h)); reverse(all(h));
  ll ans=0;
  rep(i,n){
    if(i<k) continue;
    ans+=h[i];
  }
  out(ans);
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}


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

using namespace std;

template <class T>inline T updmax(T& a, T b) {return a = max(a, b);}
template <class T>inline T updmin(T& a, T b) {return a = min(a, b);}

class Solution {
public:
	void solve() {
		int x, y;
		cin >> x >> y;
		int ret= 0;
		if(x == 1)ret += 300000;
		else if(x == 2)ret += 200000;
		else if(x == 3)ret += 100000;
		if(y == 1)ret += 300000;
		else if(y == 2)ret += 200000;
		else if(y == 3)ret += 100000;
		if(x == 1 && y == 1)ret += 400000;
		cout << ret << "\n";
		
		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

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

int n,k, result;

int main() {
  cin >> n >> k;
  vector<int> p(n);
  for(int i=0;i<n;i++) {
    cin >> p.at(i);
  }
  sort(p.begin(), p.end());
  for(int j=0;j<k;j++) {
    result += p.at(j);
  }
  cout << result << endl;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n; cin >> n;
	int v[22], c[22];
	for(int i=0;i<n;i++){
		cin >> v[i];
	}
	for(int i=0;i<n;i++){
		cin >> c[i];
	}
	int ans = 0;
	for(int i=0;i<n;i++){
		if(v[i]-c[i]>0){
			ans += v[i]-c[i];
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>//sort,reverse
#include<utility>//pair
#include<deque>//double-ended-queue
#include<queue>
using namespace std;
int main()
{ 
    int n,m;
    cin>>n>>m;
    priority_queue <long long int> q;
    long long int sum=0;
    long long int a=0;
    for(int i=0;i<n;i++){
        cin>>a;
        q.push(a);
    }
    for(int i=0;i<m;i++){
        a=q.top();
        q.pop();
        q.push(a/2);
    }
    for(int i=0;i<n;i++){
        sum=sum+q.top();
        q.pop();
    }
    cout<<sum<<endl;
    return 0;
}

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

int main()
{
	int n;
	string s;
	cin >> n >> s;
	s.erase(unique(s.begin(),s.end()),s.end());
	cout << s.size() << endl;
	return 0;
}


Measured memory_bytes: 512
def get_top2_dict(dict1):
  numlist=tuple(dict1.items())
  best=[(0,0),(0,0)]
  for x in numlist:
    if x[1]>=best[0][1]:
      best[1]=best[0]
      best[0]=x
    elif x[1]>=best[1][1]:
      best[1]=x
  return best

n=int(input())
numlist=[int(x) for x in input().split()]
even=0
odd=1
evenlist={}
oddlist={}
while even<n:
  try:
    evenlist[numlist[even]]
  except:
    evenlist[numlist[even]]=0
  evenlist[numlist[even]]+=1
  even+=2

while odd<n:
  try:
    oddlist[numlist[odd]]
  except:
    oddlist[numlist[odd]]=0
  oddlist[numlist[odd]]+=1
  odd+=2

besteven=get_top2_dict(evenlist)
bestodd=get_top2_dict(oddlist)

if besteven[0][0]!=bestodd[0][0]:
  print(n-besteven[0][1]-bestodd[0][1])
elif besteven[1][1]+bestodd[0][1]>besteven[0][1]+bestodd[1][1]:
  print(n-besteven[1][1]-bestodd[0][1])
else:
  print(n-besteven[0][1]-bestodd[1][1])

Measured memory_bytes: 19552
N,M = map(int, input().split())
path = [[] for i in range(N)]
for i in range(M):
    A,B = map(int, input().split())
    path[A-1].append(B)
    path[B-1].append(A)
    
ans = [0]*N
check = [0]*N
check[0] = 1
def func(x):
    ls = []
    for i in path[x-1]:
        if check[i-1] == 0:
            ans[i-1] = x
            check[i-1] = 1
            ls.append(i)
    return ls

fls = func(1)
while True:
    clist = []
    for i in fls:
        clist += func(i)
    if clist == []:
        break
    fls = clist
    
print('Yes')
for i in range(1,N):
    print(ans[i])

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

typedef pair<int, int> Pii;

void readint(int N, vector<int> &a);
void readdouble(int N, vector<double> &a);
void readindex(int N, vector<int> &a);



signed main(){

    int N, K;
    cin >> N >> K;

    int ans = 0;

    FOR(b, K + 1, N + 1){
        int p = (N + 1) / b;
        ans += (b - K) * p;
        int r = N % b;
        if(r != b - 1) ans += max((int)0, r - K + 1);
        if(K == 0) ans--;
    }
    

    cout << ans;

    return 0;
}








void readint(int N, vector<int> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atoi(s.c_str());
    }
    getline(cin, s, '\n');
    a[N - 1] = atoi(s.c_str());
}
void readdouble(int N, vector<double> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atof(s.c_str());
    }
    getline(cin, s, '\n');
    a[N - 1] = atof(s.c_str());
}
void readindex(int N, vector<int> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atoi(s.c_str()) - 1;
    }
    getline(cin, s, '\n');
    a[N - 1] = atoi(s.c_str()) - 1;
}

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

using namespace std;

#define all(x) begin(x), end(x)

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;

constexpr int MOD = 1e9 + 7;

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

    int n, k;
    cin >> n >> k;

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

    // dp[i][j] = number of ways to distribute j candies over i kids
    // dp[i][j] = sum dp[i - 1][j - k] over all k from 0 to a[i]

    vector<vi> dp(n + 1, vi(k + 1, 0));
    vector<vi> dp2(n + 1, vi(k + 1, 0));
    dp[0][0] = 1;
    fill(all(dp2[0]), 1);

    for (int i = 0; i < n; ++i) {
        dp[i + 1][0] = dp2[i + 1][0] = 1;
        for (int j = 1; j <= k; ++j) {
            int offset = j - a[i] - 1;
            dp[i + 1][j] = dp2[i][j] - (offset >= 0 ? dp2[i][offset] : 0);

            if (dp[i + 1][j] < 0)
                dp[i + 1][j] += MOD;

            dp2[i + 1][j] = dp[i + 1][j] + dp2[i + 1][j - 1];
            if (dp2[i + 1][j] >= MOD)
                dp2[i + 1][j] -= MOD;
        }
    }

    cout << dp[n][k] << '\n';

    return 0;
}


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


auto solve(std::vector<std::string> s){
    stringstream ss;
    ss << static_cast<char>(toupper(s[0][0])) << static_cast<char>(toupper(s[1][0])) << static_cast<char>(toupper(s[2][0]));
    return ss.str();
}

int main(){
    std::vector<std::string> s(3);
    for(int i = 0 ; i < 3 ; i++){
        std::cin >> s[i];
    }
    auto result = solve(std::move(s));
    cout << result << endl;
    return 0;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func round(f float64) int {
	return int(math.Floor(f + 0.5))
}

func main() {
	n, _ := strconv.Atoi(nextLine())

	row := nextLine()
	as := make([]int, n)
	array := strings.Split(row, " ")
	for i := 0; i < n; i++ {
		as[i], _ = strconv.Atoi(array[i])
	}

	var sum, avg int
	for _, a := range as {
		sum += a
	}
	avg = round(float64(sum) / float64(n))

	minCost := 0
	for _, a := range as {
		minCost += (a - avg) * (a - avg)
	}

	fmt.Println(minCost)
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){
  if(a % b == 0)return b;
  else{
     return(gcd(b,a% b));
  }
}
int main(){
  ll n,x;
  cin >> n >> x;
  vector<ll> a(n);
  for(int i = 0;i < n;i++){
    ll num = 0;
    cin >> num;
    a[i] = abs(x - num);
  }
  ll res = 0;
  res = a[0];
  for(int i = 1;i < n;i++)res = gcd(res,a[i]);
  cout << res << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h> 
using namespace std;
 int main(){
  long long Q,H,S,D;
	cin>>Q>>H>>S>>D;
	
	long long N;
	cin>>N;
	
	S = min({S,Q*4,H*2});
	
	cout<<min(S*N,(N/2)*D+(N%2)*S)<<endl;
	
	return 0;
}
 

Measured memory_bytes: 3616
x1, y1, x2, y2 = map(int, input().split())
x3, y3 = (x2 - y2 + y1, y2 + x2 - x1)
x4, y4 = (x3 + x1 - x2, y3 + y1 - y2)
print(x3, y3, x4, y4)


Measured memory_bytes: 9112
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        if (s.charAt(0) == s.charAt(2)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 21844
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7


u=LI()
if u.count(5)==2 and u.count(7)==1:
    print("YES")
else:
    print("NO")

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

#define pii pair<int, int>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define sz(v) int(v.size())
#define all(v) v.begin(), v.end()
#define vec vector<int>
#define dead not_bad
#define bad gooood

#define left not_right
#define y1 what

using namespace std;

const int N = (int) 1e5 + 10;
const int M = (int) 1e6 + 10;
const ll LINF = (ll) 1e18;
const int INF = (int) 1e9 + 7;
const int ALPHA = 26;
const int mod = INF + 2;
const double PI = 3.14159265359;
const ld EPS = (ld) 1e-12;

const int nx[4] = {0, 0, -1, 1};
const int ny[4] = {1, -1, 0, 0};

int n;
ll lim;

struct node {
  int go[2];
  bool bad;

  node() {
    memset(go, -1, sizeof(go));
    bad = 0;
  }
};

node t[M];
int sz;
ll ans;

void add(string s) {
  int cur = 0;
  for (auto it : s) {
    int ch = it - '0';
    if (t[cur].go[ch] == -1) {
      t[cur].go[ch] = ++sz;
    }
    cur = t[cur].go[ch];
  }
  t[cur].bad = 1;
}

bool dbg;

ll get(ll x) {
  ll cur = 1;
  while (x % 2 == 0) {
    cur *= 2;
    x /= 2;
  }
  return cur;
}

void dfs(int x, ll len = 0) {
  if (len > lim)
    return;
  if (x == -1) {
    ans ^= get(lim - len + 1);
    return;
  }
  if (dbg) cout << x << " " << t[x].bad << "\n";
  if (t[x].bad)
    return;
  if (dbg) cout << x << " " << t[x].go[0] << len + 1 << " 0\n";
  dfs(t[x].go[0], len + 1);
  if (dbg) cout << x << " " << t[x].go[1] << len + 1 <<" 0\n";
  dfs(t[x].go[1], len + 1);
}

int main() {
  #define fn "saddle"
  #ifdef witch
      freopen("input.txt", "r", stdin);
  //    freopen("output.txt", "w", stdout);
  #else
      //freopen(fn".in", "r", stdin);
      //freopen(fn".out", "w", stdout);
  #endif
  cin >> n >> lim;
  for (int i = 1; i <= n; i++) {
    string st;
    cin >> st;
    add(st);
  }
  dfs(0);
  /*
  |ans| good strings of shortest length
  [0] [(0 & 1) | {}]
  [111]
  */
  if (ans == 0) cout << "Bob";
  else cout << "Alice";
  return 0;
}


Measured memory_bytes: 16028
using System;
namespace atcoder110A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            Array.Sort(input);
            Array.Reverse(input);
            int A = input[0];
            int B = input[1];
            int C = input[2];
            int ans = A * 10 + B + C;
            Console.WriteLine(ans);
        }
    }
}

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

int main(){

    int a,b,c;

    cin >> a >> b >> c;

    int max_n = max({a,b,c});
    

    int gap1, gap2;
    
    if(max_n == a){
        gap1 = max_n - b;
        gap2 = max_n - c;
    }else if(max_n == b){
        gap1 = max_n - a;
        gap2 = max_n - c;
    }else{
        gap1 = max_n - a;
        gap2 = max_n - b;
    }
  
    int ans;
    if(gap1 % 2 == 0 && gap2 % 2 == 0){
        ans = gap1/2 + gap2/2;
    }else if(gap2 % 2 == 1 && gap1 % 2 == 1){
        ans = gap1/2 + gap2/2 + 1;
    }else if(gap1 % 2 == 0 && gap2 % 2 == 1){
        ans = gap1/2 + gap2/2 + 2;
    }else{
        ans = gap1/2 + gap2/2 + 2;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

#define LINE_BUFSIZ 1024

int main(int argc, char **argv)
{
  char buf[LINE_BUFSIZ];

  if (!fgets(buf, LINE_BUFSIZ, stdin)) {
    perror("fgets");
    exit(1);
  }

  int N = atoi(buf);
  int a = N;

  for (int i = 0; i <= N; i++) {
    int cc = 0, t = i;
    while (t > 0) { cc += t % 6; t /= 6; }
    t = N - i;
    while (t > 0) { cc += t % 9; t /= 9; }

    if (a > cc) a = cc;
  }

  printf("%d\n", a);

  return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[][] P = new int[N][3];
        int x0 = 0;
        int y0 = 0;
        int h0 = 0;
        for(int i = 0; i<N; i++){
            P[i][0] = sc.nextInt();
            P[i][1] = sc.nextInt();
            P[i][2] = sc.nextInt();
            if(P[i][2] != 0 && h0 == 0) {
                x0 = P[i][0];
                y0 = P[i][1];
                h0 = P[i][2];
            }
        }
        sc.close();
        int H;
        int t;
        for(int j = 0; j<101; j++){
            boolean res1 = false;
            for(int k = 0; k <101; k++){
                boolean res2 = true;
                H = h0 + Math.abs(j - x0) + Math.abs(k - y0);
                for(int[] p :P){
                        t = Math.max(0, H - Math.abs(j - p[0]) - Math.abs(k - p[1])) ;
                    if(t != p[2]){
                        res2 = false;
                        break;
                    }
                }
                if(res2){
                    System.out.println(j + " " + k + " " + H);
                    res1 = true;
                    break;
                }
            }
            if(res1) break;
        }

    }

}


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

using namespace std;
#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 all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;

template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    os << "{" << p.first << ", " << p.second << "}";
    return os;
}

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 int INF = (ll) 1e9;
const ll INFLL = (ll) 1e18 + 1;
const ll MOD = (ll) 1e9 + 7;
const double PI = acos(-1.0);

/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int N, K, C;
    cin >> N >> K >> C;
    string S;
    cin >> S;
    vector<int> v;
    rep(i,N){
        if(S[i] == 'o')v.emplace_back(i);
    }
    //前から見たときのやつ
    vector<int> mae(K);
    int sz = v.size();
    int cnt = 0;
    for(int l = 0; l < sz;){
        int r = l+1;
        while(r < sz && v[l] + C + 1 >  v[r]){
            r++;
        }
        mae[cnt] = v[l];
        cnt++;
        if(cnt == K)break;
        l = r;
    }
    vector<int> usi(K);
    cnt = K - 1;
    for(int r = sz-1; r >= 0;){
        int l = r - 1;
        while(l >= 0 && v[l] > v[r] - C - 1){
            l--;
        }
        usi[cnt] = v[r];
        cnt--;
        if(cnt == -1)break;
        r = l;
    }
    rep(i,K){
        if(mae[i] == usi[i]){
            cout << mae[i]+1 << endl;
        }
    }
}

Measured memory_bytes: 4236
#include <bits/stdc++.h>
using namespace std;
 
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ", "; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ", "; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << ", " << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << ": " << v.second << ", "; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << ": " << v.second << ", "; os << "}"; return os; }
template<typename T> void ndarray(vector<T> &vec, int len) { vec.resize(len); }
template<typename T, typename... Args> void ndarray(vector<T> &vec, int len, Args... args) { vec.resize(len); for (auto &v : vec) ndarray(v, args...); }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }
template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first - r.first, l.second - r.second); }
#define f first
#define s second
 
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> dp(3);
    int a, b, c;
    cin >> a >> b >> c;
    dp[0] = a;
    dp[1] = b;
    dp[2] = c;
    for(int i = 1; i < n; i++) {
        cin >> a >> b >> c;
        int A = max(dp[1], dp[2]) + a, B = max(dp[0], dp[2]) + b, C = max(dp[0], dp[1]) + c;
        dp[0] = A;
        dp[1] = B;
        dp[2] = C;
    }
    cout << max({dp[0], dp[1], dp[2]});
}



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

int main() {
  int k, n;
  cin >> k >> n;
  
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  
  vector<int> b(n);
  for (int i = 0; i < n; i++) {
    if (i == n - 1)
      b.at(i) = k + a.at(0) - a.at(i);
    else
      b.at(i) = a.at(i + 1) - a.at(i);
  }
  
  sort(b.begin(), b.end());
  reverse(b.begin(), b.end());
  
  cout << k - b.at(0) << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

Int a[100005];
int main(){
    cin.tie(0);

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

    Int low = 2;
    Int high = 2;

    for (int i = N-1; i >= 0; i--){
        Int lowtmp;
        Int hightmp;
        lowtmp = ((low+a[i]-1)/a[i]) * a[i];
        hightmp = high/a[i] * a[i];
        if (lowtmp < low || lowtmp > high){
            cout << -1 << endl;
            return 0;
        }
        low = lowtmp;
        high = hightmp + a[i] - 1;
    }

    cout<< low << " " << high << endl;
}


Measured memory_bytes: 1024
S = input()
 
a = (S[0] == 'R')
b = (S[1] == 'R')
c = (S[2] == 'R')
 
if a and b and c:
  print(3)
elif (a and b and (c == False)) or ((a == False) and b and c):
  print(2)
elif (a == False) and (b == False) and (c == False):
  print(0)
else:
  print(1)

Measured memory_bytes: 9068
#include <stdio.h>

#define MAX 100


void insertion(int *A , int N){
  int i ,j;
  int v;

  for(i = 0 ; i <= N-1 ; i++){
    v = A[i];
    j = i-1;
    while(j >= 0 && A[j] > v){
      A[j+1] = A[j];
      j--;
      A[j+1] = v;
    }
    for( j = 0 ; j < N ; j++){
      printf("%d", A[j]);
      if( j != N-1) printf(" ");
    }
    printf("\n");
  }
  return;
}

int main(void){

  int N;
  int A[MAX];
  int i;

  scanf("%d",&N);

  for(i = 0 ; i < N ; i++){
    scanf("%d",&A[i]);
  }

  insertion(A, N);


  return 0;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
#define F first
#define S second
#define sz(x) (int)x.size()
#define db(x) cerr << #x << ": " << x << "\n";

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

    int K; string S;
    cin >> K >> S;
    if(K < sz(S))
        cout << S.substr(0,K) << "...";
    else
        cout << S;
}


Measured memory_bytes: 3592
#include <cstdio>
using namespace std;
int main()
{
    int a,b,c,x,ans=0;
	scanf("%d %d %d %d",&a,&b,&c,&x);
	for(int i=0;i<=a;i++)
		for(int j=0;j<=b;j++)
			for(int k=0;k<=c;k++)
				if(i*500+j*100+k*50==x)
					ans++;
	printf("%d\n",ans);
}


Measured memory_bytes: 128
//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>
#include <climits>
#include <limits>

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())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++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

int h, w;
int sx, sy;
int gx, gy;

int vx[4] = { 0,1,0,-1 };
int vy[4] = { 1,0,-1,0 };

vector<string> g;
vector<vector<int>> dist;
vector<vector<bool>> visited;

void dfs() {
	queue<pair<int, int>> que;
	visited[sy][sx] = true;
	dist[sy][sx] = 0;
	que.emplace(sy, sx);

	while (!que.empty()) {
		auto p = que.front();
		que.pop();

		for (int i = 0; i < 4; i++) {
			int ny = p.first + vy[i], nx = p.second + vx[i];

			//範囲外判定
			if (nx < 0 || ny < 0 || nx >= w || ny >= h)continue;

			//もういったマスにはいかない
			if (visited[ny][nx])continue;

			//壁は進めない
			if (g[ny][nx] == '#')continue;

			visited[ny][nx] = true;

			//次に行く前に距離を更新して
			dist[ny][nx] = dist[p.first][p.second] + 1;

			//次にいく
			que.emplace(ny, nx);
		}
	}

}

int main() {

	sx = 0, sy = 0;

	cin >> h >> w;
	g.resize(h);

	visited.resize(h);
	for (int i = 0; i < h; i++) {
		visited[i].resize(w);
	}

	dist.resize(h);
	for (int i = 0; i < h; i++) {
		dist[i].resize(w,-1);
	}


	int black = 0;
	for (int i = 0; i < h; i++) {
		cin >> g[i];

		for (int j = 0; j < w; j++) {
			if (g[i][j] == '#')black++;
		}

	}

	dfs();

	int s = dist[h - 1][w - 1];

	if (s==-1)
	{
		cout << "-1" << endl;

	}
	else {
		cout << h * w - black - s - 1 << endl;
	}


	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define rusha scanf("%d",&n);rep(i,1,n)scanf("%d",&a[i]);
#define rushb scanf("%d",&t);while(t--)
#define debug(x) cout<<" L-B-W-- "<<x<<" --N-B\n"
#define pb push_back
#define pii pair<int,int>
#define vii vector<int>
#define fi first
#define se second
#define mem(a,b) memset(a,b,sizeof a)
#define all(x) (x.begin(),x.end())
#define judgef printf("%s\n",f?"Yes":"No")
#define Judgef printf("%s\n",f?"YES":"NO")
#define sz(x) ((int)(x).size())
#define sf(x) (sizeof(x))
using namespace std;
typedef long long ll;
typedef double db;
const double pai = acos(-1.0);
const double eps = 1e-8;
const int mod=998244353;
//const int mod=1e9+7;
const int inf=1e9+7;
//const ll inf=0x7f7f7f7f1234abcd;
const int maxn=2e5+10;
inline ll ksm(ll x,ll y){ll res=1;while(y){if(y&1)res=res*x%mod;x=x*x%mod;y>>=1;}return res;}
inline ll inv(ll a,ll p){if(a==1)return 1;return (p-p/a)*inv(p%a,p)%p;}
inline ll lcm(ll a,ll b){return a * b / __gcd(a, b);}
int t,n,m,k;
int main() {
    int n;
    cin >> n;
    vector<tuple<bool, int, int, int>> v(n);
    for (auto &e : v) {
    string s;
    cin >> s;
    int l = 0, r = 0;
    for (auto c : s) {
      if (c == '(') {
        l++;
      } else if (l > 0) {
        l--;
      } else {
        r++;
      }
    }
    e = {l <= r, l <= r ? (l==0?inf:-r-l) : r, l, r};
    }
    sort(v.begin(), v.end());

    bool valid = true;
    int h = 0;
    //for (auto [a, b, l, r] : v)  cerr << a << ' ' << b << ' ' << l << ' ' << r << endl;
    for (auto [a, b, l, r] : v) {
     //cerr << a << ' ' << b << ' ' << r << ' ' << l << endl;
    if (h < r) {
      valid = false;
      break;
    }
    h -= r;
    h += l;
    }
    if (h != 0) valid = false;
    cout << (valid ? "Yes" : "No") << endl;
}


Measured memory_bytes: 18824
#include "bits/stdc++.h"
#define ll long long
#define lld long double
#define MOD 1000000007
#define inf 1000000007
#define pii pair<int,int>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
// ll power(ll x,ll y, ll md=inf){ll res = 1;x%=md;while(y){if(y&1)res = (res*x)%md;x *= x; if(x>=md) x %= md; y >>= 1;}return res;}
 
using namespace std;


#define endl '\n'
// #define int ll

signed main() {
	fast;

	int h,w;
	cin>>h>>w;

	pii v[200002];
	for(int i=0;i<h;i++) cin>>v[i].f>>v[i].s;

	map<int,int> mp;
	for(int i=1;i<=w;i++) mp[i] = 0;

	map<int,int> mini = {{0,w}};

	for(int i=0;i<h;i++) {
		int r = v[i].s;

		auto it = mp.lower_bound(v[i].f);


		if(r==w) {
			while(it!=mp.end() && it->f <= r) {
				auto it1 = it++;
				auto it2 = mini.find(it1->s);
				if(it2->s==1) mini.erase(it2);
				else it2->s --;
				mp.erase(it1);
			}

			if(mini.size()) cout<<mini.begin()->f+i+1<<endl;
			else cout<<-1<<endl;
		}
		else {
			int mn = inf;

			while(it!=mp.end() && it->f <= r) {
				mn = min(mn, r+1-(it->f)+(it->s));
				auto it1 = it++;
				auto it2 = mini.find(it1->s);
				if(it2->s==1) mini.erase(it2);
				else it2->s --;
				mp.erase(it1);
			}

			if(mn<inf) {
				if(it!=mp.end() && it->f == r + 1) {
					if(it->s > mn) {
						auto it1 = mini.find(it->s);
						if(it1->s ==1) mini.erase(it1);
						else it1->s --;
						mini[mn]++;
						it->s = mn;
					}
				}
				else {
					mp.insert({r+1,mn});
					mini[mn]++;
				}
				cout<<mini.begin()->f+i+1<<endl;
			}
			else {
				if(mini.size()) cout<<mini.begin()->f+i+1<<endl;
				else {
					for(int j=i;j<h;j++) {
						cout<<-1<<endl;
					}
					return 0;
				}
			}

		}

	}
}

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

int main() {
  int k, s;
  long long res = 0;
  cin >> k >> s;
  for (int i = 0; i <= k; i++) {
    for (int j = 0; j <= k; j++) {
      int z = s - i - j;
      if (z >= 0 && z <= k) res++;
    }
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int f[100010]={0},h[100010]={0},n,k;
int main(){
	scanf("%d %d",&n,&k);
	f[100004]=10007;
	for(int i=1;i<=n;i++) scanf("%d",&h[i]);
	f[1]=0;
	for(int i=2;i<=n;i++){
		f[i]=2000000000;
		for(int j=max(1,i-k);j<i;j++){
			f[i]=min(f[i],abs(h[i]-h[j])+f[j]);
		}
	}
	cout<<f[n];
	return 0;
}

Measured memory_bytes: 1024
A = int(input())
B = int(input())
C = int(input())
X = int(input())

counter = 0
for i in range(0, A+1):
    ans = X - 500 * i
    if ans > 0:
        for n in range(0, B+1):
            ans1 = ans - 100 * n
            if ans1 > 0 and (ans1 / 50) <= C:
                counter += 1
            elif ans1 == 0:
                counter += 1
    elif ans == 0:
        counter += 1
print(counter) 

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

const ll MAX = 200000;
const ll INF = 1001001001;
const ll MOD = 1000000007;

ll N, ans=0, tmp=0;
vector<ll> A;
ll fac[MAX], finv[MAX], inv[MAX];

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

signed main(){
    cin >> N;
    COMinit();
    for(int i=0;i<N;i++) {
        ll a;
        cin >> a;
        a -= tmp;
        if(i) A.push_back(a);
        tmp = a+tmp;
    }
    ll s = 0;
    for(int i=1;i<N;i++) {
        s += fac[N-1]*modinv(i,MOD);
        s %= MOD;
        ans += s*A[i-1];
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 8952
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int arr[n][3],dp[n][3];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
    }
    dp[0][0]=arr[0][0];
    dp[0][1]=arr[0][1];
    dp[0][2]=arr[0][2];
    for(int i=1;i<n;i++)
    {
        dp[i][0]=arr[i][0]+max(dp[i-1][1],dp[i-1][2]);
        dp[i][1]=arr[i][1]+max(dp[i-1][0],dp[i-1][2]);
        dp[i][2]=arr[i][2]+max(dp[i-1][0],dp[i-1][1]);
    }
    
    cout<<(max(max(dp[n-1][0],dp[n-1][1]),dp[n-1][2]));
}

    

Measured memory_bytes: 5928
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
#define mod ((ll)1e9+7)
#define inf ((ll)1e18+5)
#define maxx ((ll)1e6+5)
#define pb push_back
#define endl "\n"
#define time(i) cout<<"\nTime Elapsed "<<i<<" : " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
#define usefile freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define test ll t; cin>>t; while(t--)
ll exp(ll x,ll y,ll p){ ll res=1; while(y) {if(y%2) res=(res*x%p)%p; x=(x*x)%p; y/=2; } return res;}
ll expm(ll x,ll y){ ll res=1; while(y) {if(y%2) res=(res*x%mod)%mod; x=(x*x)%mod; y/=2; } return res;}
/*
bool sv[maxx]={0};    // returns 0 if a num is prime
int sp[maxx]={0};     // gives smallest prime factor of the number
void Sieve() {for(int i= 2; i< maxx; i+= 2) sv[i]=1,sp[i] = 2;sv[2]=0;for(ll i = 3; i < maxx; i += 2){if (!sv[i]){sp[i] = i;for (ll j = i; (j*i) < maxx; j += 2){if (!sv[j*i])sv[j*i] = true, sp[j*i] = i;}}}}
ll fact[1000007]={0}; // returns factorial of that number
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<1000007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(expm(fact[r],mod-2)))%mod; res=(res*(expm(fact[n-r],mod-2)))%mod; return res;}
*/
signed main(){
  fast;
  //usefile;
  //test
  {
    int n,r;
    cin>>n>>r;
    if(n>=10)
    {
      cout<<r<<endl;
    }
    else{
      int ans=r+100*(10-n);
      cout<<ans<<endl;
    }    
  }
  //time("");
  return 0;
}

Measured memory_bytes: 256
a,b,k = map(int,input().split())

ans = []
for i in range(k):
    x = a+i
    if (x not in ans) and x<=b: 
        ans.append(x)
for j in range(k,0,-1):
    x = b-j+1
    if (x not in ans) and x>=a:
        ans.append(x)
print('\n'.join(map(str,ans)))

Measured memory_bytes: 3060
#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
typedef long long ll;


int main(int argc, char *argv[])
{
	int a1,a2,a3;

	cin >> a1 >> a2 >> a3;

	cout << ((a1+a2+a3)>21 ? "bust": "win") << endl;
}



Measured memory_bytes: 256
import math
from collections import Counter
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()
            
            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

mysum = math.factorial(n)

i = 2

if mysum==1:
    
    arr=[]

else:

    arr = []
    while i < mysum:

        if mysum % i == 0:

            arr.append(i)

            mysum = mysum // i

        else:

            i+=1

    else:

        arr.append(i)


list01=Counter(arr)

cnt=1
for k in list01:

    cnt *=list01[k]+1

print(cnt % (10 **9 +7))        



Measured memory_bytes: 3436
h, w = map(int, input().split())
s = [input() for _ in range(h)]

for i in range(h):
    result = []
    for j in range(w):
        if s[i][j] == '#':
            result.append('#')
        elif s[i][j] == '.':
            cnt = 0
            for y in range(-1, 2):
                for z in range(-1, 2):
                    if 0 <= i+y <= h-1:
                        if 0 <= j+z <= w-1:
                            if s[i+y][j+z] == '#':
                                cnt += 1
            result.append(str(cnt))
    print(*result, sep='')



Measured memory_bytes: 9108
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<math.h>
#include<map>
using namespace std;
using ll = long long;
int main() {
    string s;
    string t;
    cin >> s >> t;
    int count = 0;
    for(int i=0;i<s.length();i++){
        if(s.at(i) != t.at(i)){
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

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

using namespace std;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    if (a < 10 && b < 10) {
        cout << (a*b) << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<stack>
using namespace std;
typedef long long ll;
#define N 500015
const int bas=23333,bs=2333;
const int p=1e9+7,pp=1e9+9;
char ch[N];
int n;
int ha[N],bin[N],hh[N],bn[N];
vector<int>v[N];
inline int geh(int l,int r){return (ha[r]-1ll*ha[l-1]*bin[r-l+1]%p+p)%p;}
inline int gh(int l,int r){return (hh[r]-1ll*hh[l-1]*bn[r-l+1]%pp+pp)%pp;}
inline bool jud(int l,int r)
{
	for(int i=0;i<v[r-l+1].size();i++)
	{
		int x=v[r-l+1][i];
		if(geh(l,r-x)==geh(l+x,r)&&gh(l,r-x)==gh(l+x,r))return true;
	}return false;
}
int main()
{
    scanf("%s",ch+1);n=strlen(ch+1);bool flag=true;
    for(int i=2;i<=n;i++)if(ch[i]!=ch[1]){flag=false;break;}
    if(flag){printf("%d\n%d\n",n,1);return 0;}
    for(int i=1;i<=n;i++)for(int j=i+i;j<=n;j+=i)v[j].push_back(i);
    bin[0]=bn[0]=1;for(int i=1;i<=n;i++)bin[i]=1ll*bin[i-1]*bas%p,bn[i]=1ll*bn[i-1]*bs%pp;
    for(int i=1;i<=n;i++)ha[i]=(1ll*ha[i-1]*bas+ch[i]-'a'+1)%p,hh[i]=(1ll*hh[i-1]*bs+ch[i]-'a'+1)%pp;
    if(!jud(1,n)){puts("1");puts("1");return 0;}
	puts("2");
	int ans=0;
	for(int i=1;i<n;i++)
	{
		if((!jud(1,i))&&(!jud(i+1,n)))ans++;
	}printf("%d\n",ans);
}


Measured memory_bytes: 64128
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}
void check(long long a,long long b,long long c,long long d){
    long long same=a;
    a = a-b;
    while(same != a && a >= 0){
        cout << a << endl ;
        if(a <= c){
            a += d;
            if(a == same){
                cout << "Yes" << endl;
                return;
            }
        }
        a = a-b ;
    }

    if(a<0)
        cout << "No" << endl;
    return;
}


int main(int argc, const char * argv[]) {
    
    // source code
    int N;
    int H;
    int W;
    cin >> N >> H >> W;

    int A[N];
    int B[N];
    int cnt = 0;
    for(int i = 0;i<N;i++){
        cin >> A[i] >> B[i];
        if(A[i] >= H && B[i] >= W){
            cnt+=1;
        }
    }
    cout << cnt <<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	long long n, a = 0, b = 1, c = 0, d = 0, e = 0;
	string s; cin >> s >> n; int test[1001] = { 0 };
	for (int h = 0; h < s.size(); h++) {
		if (s[h] == s[h + 1]) {
			a++; b = 0;
		}
		else {
			c += (a + 1) / 2; b = 1;
			test[d] = a + 1; d++; a = 0;
		}
	}
	if (s[0] == s[s.size() - 1]) {
		if (d == 1) {
			c -= test[0] / 2;
			e += test[0] * (n - 1) / 2;
			e += test[0] / 2;
		}
		else {
			c -= test[0] / 2; c -= test[d - 1] / 2;
			e += (test[0] + test[d - 1]) / 2 * (n - 1);
			e += test[0] / 2 + test[d - 1] / 2;
		}
	}
	cout << c * n + e << endl;
	cin >> n;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep_1(i,n) for(int (i)=0;(i)<=(n);(i)++)
#define rep_2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main(){
    double n;cin >>n;
    double sum = 0;
    rep(i,n) {
        double tmp = 0;
        cin >>tmp;
        tmp = 1/tmp;
        sum += tmp;
    } 
    cout << 1/sum<<endl;
}



Measured memory_bytes: 256
a, b, m = map(int, input().split())

a_prices = [int(i) for i in input().split()]
b_prices = [int(i) for i in input().split()]

min_price = min(a_prices) + min(b_prices)

for _ in range(m):
    x, y, c = map(int, input().split())
    x -= 1
    y -= 1
    min_price = min(min_price, a_prices[x] + b_prices[y] - c)
print(min_price)


Measured memory_bytes: 70468
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int n,a[200005],b[200005];
ll ans;
ll mn = 1e18;
bool dif;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d%d",&a[i],&b[i]);
		ans += b[i];
		if(a[i] != b[i]) dif = 1;
		if(a[i] > b[i]) mn = min(mn,1LL*b[i]);
	}
	if(!dif){
		puts("0"); return 0;
	}
	cout<<ans-mn<<endl;
}

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

#define lli long long int
#define pb push_back
#define in insert
#define pi pair<int, int>
#define pd pair<double, int>
#define pib pair<pi, bool>
#define mp make_pair
#define fir first
#define sec second
#define MAXN 10001
#define MAXL 1000001
#define mod 1000000007

signed main()
{
  lli sal = 100;
  lli n;
  cin >> n;
  lli ans = 0;
  while (1)
  {
    if (sal >= n)
      break;
    ans++;
    sal = sal + (sal / 100);
  }
  cout << ans << endl;
  return 0;
}

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

int main()
{
	int x, a, b;
	int A, B;
	cin >> x >> a >> b;
	A = a - x;
	if (A > 0)
		A = A;
	else
		A = -1 * A;
	B = b - x;
	if (B > 0)
		B = B;
	else
		B = -1 * B;
	if (A > B)
		cout << "B";
	else
		cout << "A";
	return 0;
}

Measured memory_bytes: 256