akhauriyash/Code-Regression huggingface dataset:
package main

import (
	"bufio"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"strconv"
	"strings"
)

const debug = false

func (p *problem) solve() {
	s := p.Next()
	if strings.Contains(s, "a") && strings.Contains(s, "b") && strings.Contains(s, "c") {
		p.Printf("Yes")
	} else {
		p.Printf("No")
	}
}

func main() {
	if debug {
		log.SetOutput(os.Stdout)
	} else {
		log.SetOutput(ioutil.Discard)
	}

	p := problem{
		in:  bufio.NewReader(os.Stdin),
		out: bufio.NewWriter(os.Stdout),
	}
	p.solve()

	if err := p.out.Flush(); err != nil {
		panic(err)
	}
}

type problem struct {
	in  *bufio.Reader
	out *bufio.Writer
}

func (p *problem) PrintInt(d int) {
	p.Printf("%d", d)
}

func (p *problem) Printf(format string, a ...interface{}) {
	if _, err := fmt.Fprintf(p.out, format, a...); err != nil {
		panic(err)
	}
}

func (p *problem) NextInt() int {
	return stoi(p.Next())
}

func (p *problem) NextInts() []int {
	line := p.NextSSLine()
	ds := make([]int, len(line))
	for i, s := range line {
		ds[i] = stoi(s)
	}
	return ds
}

func (p *problem) NextSSLine() []string {
	return strings.Split(p.Next(), " ")
}

// Next reads line and return string.
func (p *problem) Next() string {
	var b []byte
	for {
		l, pre, err := p.in.ReadLine()
		if err != nil {
			panic(err)
		}
		b = append(b, l...)
		if !pre {
			break
		}
	}
	return string(b)
}

func stoi(s string) int {
	i, err := strconv.Atoi(s)
	if err != nil {
		fmt.Println(i)
		fmt.Println(err)
	}
	return i
}


Measured memory_bytes: 640
N,K = (int(x) for x in input().split())
A = list(map(int, input().split()))
route = []
visited = set()
temp = 0
for i in range(N):
    route.append(temp)
    visited.add(temp)
    temp = A[temp]-1
    if temp in visited:
        before_loop = route.index(temp)
        period = len(route) - before_loop
        break
if K - before_loop < period:
    print(route[K]+1)
else:
    print(route[before_loop+(K-before_loop)%period]+1)

Measured memory_bytes: 35576
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        String sub1 = s.substring(0, (n-1)/2);
        String sub2 = s.substring((n+3)/2-1, n);

        if (isP(s) && isP(sub1) && isP(sub2)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        
    }
    
    private static boolean isP(String s){
      //System.out.println(s);
        int l = 0;
        int r = s.length()-1;
        while (l <= r) {
            if (s.charAt(l) != s.charAt(r)) return false;
            l++;
            r--;
        }
        return true;
        
    }
}

Measured memory_bytes: 21716
def check(li,lj,lk):
    if (li+lj > lk) and (li+lk > lj) and (lj+lk > li):
        return True
    else:
        return False

def main():
    n = int(input())
    l = list(map(int, input().split()))

    count = 0

    for i in range(n-2):
        for j in range(i+1, n-1):
            for k in range(j+1, n):
                if l[i]!=l[j] and l[i]!=l[k] and l[j]!=l[k] and check(l[i],l[j],l[k]):
                    count += 1

    print(count)
    
if __name__=='__main__':
    main()


Measured memory_bytes: 9200
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i < (n); i++)
#define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
using namespace std;
using ll = long long;
int INF = 1001001001;

int main() {
  int l, r, d;
  cin >> l >> r >> d;
  int ans = 0;
  for(int i=l; i<=r; i++) {
    if(i%d == 0) ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,n) for (int i=0;i<(n);i++)

int main()
{
    string s;
    cin >> s;
    ll len = s.length();
    for (ll i = 0; i < len; i += 2) {
        cout << s[i];
    }
    cout << endl;
}


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

// template {{{
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); (i) -= 1)

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

constexpr int dx[] = {0, -1, 1, 0, -1, 1, -1, 1};
constexpr int dy[] = {-1, 0, 0, 1, -1, -1, 1, 1};

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

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

template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_vector(ts...))>(a, make_vector(ts...)); }

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// }}}

void solver() {
    int n = input(), m = input(), k = input();
    vector< i64 > as(n + 1);
    vector< i64 > bs(m + 1);
    range(i, 1, n + 1) cin >> as[i];
    range(i, 1, m + 1) cin >> bs[i];

    range(i, 1, n + 1) as[i] += as[i - 1];
    range(i, 1, m + 1) bs[i] += bs[i - 1];

    int idx = m;
    int ans = 0;
    range(i, 0, n + 1) {
        while (idx > 0 && as[i] + bs[idx] > k) {
            idx--;
        }

        if (as[i] > k) continue;
        chmax(ans, i + idx);
    }

    cout << ans << endl;
}

signed main(int argc, char *argv[]) {
    solver();
}


Measured memory_bytes: 6348
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];
    s = r.readLine();
    sl = s.split(" ");

    int d = Integer.parseInt(sl[0]);
    int n = Integer.parseInt(sl[1]);
    
    n += (n == 100 ? 1 : 0);
    
    for(int i = d; i > 0; i--)
    {
      n *= 100;
    }
    
    System.out.println(n);

  }

}

Measured memory_bytes: 20948
require 'prime'
require 'set'
require 'tsort'
include Math
ALP = ('a'..'z').to_a
INF = 0xffffffffffffffff
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def pr?(num);              Prime.prime?(num)                          end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end

x,y = gi
cur = x
ct = 1
loop() do
break if cur * 2 > y
cur = 2*cur
ct += 1
end
puts ct


Measured memory_bytes: 2684
import java.io.*;
import java.util.*;
import static java.lang.System.out;

public class Main{
    static MyReader in = new MyReader();

    public static void main(String[] args){
        int X, Y; {int[] a = in.ii(); X = a[0]; Y = a[1];}
        int sum = X+Y;
        long ans = 0;
        if(sum % 3 == 0){
            int m = (2*X-Y)/3;
            int n = (-X+2*Y)/3;
            if(m >= 0 && n >= 0){
                ans = ModOp.nCr(m+n, m);
            }
        }
        out.println(ans);
    }

    static class ModOp {
        static long MOD = 1000000007;

        static long pow(long a, long b){
            long ret = 1;
            while(b > 0){
                if(b%2 == 1){
                    ret = ret*a%MOD;
                }
                a = a*a%MOD;
                b /= 2;
            }
            return ret;
        }

        static long mul(int s, int e){
            long ret = 1;
            for(int i = s; i <= e; i++){
                ret = ret*i%MOD;
            }
            return ret;
        }

        static long fact(int n){
            return mul(1, n);
        }

        static long nCr(int n, int r){
            return mul(n-r+1, n) * pow(fact(r), MOD-2) % MOD;
        }

    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        ArrayList<Integer> li(){
            String[] ss = ss();
            ArrayList<Integer> li = new ArrayList<>();
            for(int j = 0; j < ss.length; j++) li.add(Integer.parseInt(ss[j]));
            return li;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
}


Measured memory_bytes: 23380
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define STRINGIFY(n) #n
#define TOSTRING(n) STRINGIFY(n)
#define PREFIX "#" TOSTRING(__LINE__) "| "
#define debug(x) \
{ \
  std::cout << PREFIX << #x << " = " << x << std::endl; \
}

std::ostream& output_indent(std::ostream& os, int ind) {
  for(int i = 0; i < ind; i++) os << " ";
  return os;
}

template<class S, class T> std::ostream& operator<<(std::ostream& os, const std::pair<S, T>& p);
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v);

template<class S, class T> std::ostream& operator<<(std::ostream& os, const std::pair<S, T>& p) {
  return (os << "(" << p.first << ", " << p.second << ")");
}
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  os << "[";
  for(int i = 0;i < v.size();i++) os << v[i] << ", ";
  return (os << "]");
}

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) { return std::vector<T>(n, std::forward<T>(val)); }
template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}
template<class Cond> struct chain {
  Cond cond; chain(Cond cond) : cond(cond) {}
  template<class T> bool operator()(T& a, const T& b) const { if(cond(a, b)) { a = b; return true; } return false; }
};
template<class Cond> chain<Cond> make_chain(Cond cond) { return chain<Cond>(cond); }

int main() {
  string S;
  cin >> S;
  i64 K;
  cin >> K;
  i64 N = S.size();
  auto dp = ndvec(N + 1, N + 1,K + 1, i64(0));
  rep(i,0,N) {
    dp[i][i + 1][0] = 1;
  }
  auto chmax = make_chain(std::less<i64>());
  rep(len,2,N + 1) {
    rep(l,0,N) {
      i64 r = l + len;
      if(r > N) break;
      i64 cost;
      if(S[l] == S[r - 1]) cost = 0;
      else                 cost = 1;
      rep(k,0,K + 1) {
        if(k - cost >= 0) {
          chmax(dp[l][r][k], dp[l + 1][r - 1][k - cost] + 2);
        }
        chmax(dp[l][r][k], dp[l + 1][r][k]);
        chmax(dp[l][r][k], dp[l][r - 1][k]);
      }
    }
  }
  cout << *max_element(all(dp[0][N])) << endl;
}


Measured memory_bytes: 219896
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for(int i=0; i<(a); i++)
typedef long long ll;
template<typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template<typename T>
using Edges = vector<edge<T>>;
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template<typename T>
using Matrix = vector<vector<T>>;

/////////////////////////////////////////////////////////////////////
const ll inf = 1LL<<60;

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

  ll ans = min(n, m/2);
  ll x = m - 2*n;
  if (x > 0) ans += x/4;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
def solve():
    # from bisect import bisect_left
    import sys

    N = int(input())
    A = [int(x) for x in sys.stdin.readline().split()]
    B = [int(x) for x in sys.stdin.readline().split()]
    M = max(A) + max(B)
    K = len(bin(M)) - 2
    mask = (1 << K) - 1
    k = K - 1
    T = 1 << k
    ans = 0
    while k >= 0:
        B = list(sorted(b & mask for b in B))
        A = list(sorted(a & mask for a in A))
        bit = 0
        T1, T2, T3 = 0, 0, 0
        for a in reversed(A):
            while T1 < N and a + B[T1] < T:
                T1 += 1
            while T2 < N and a + B[T2] < 2 * T:
                T2 += 1
            while T3 < N and a + B[T3] < 3 * T:
                T3 += 1
            # T1 = bisect_left(B, T - a, T1)
            # T2 = bisect_left(B, 2 * T - a, T2)
            # T3 = bisect_left(B, 3 * T - a, T3)
            # T4 = bisect_left(B, 4 * T - a, T4)
            bit += (N - T3) + (T2 - T1)
            bit &= 1
        ans += bit * T
        k -= 1
        T >>= 1
        mask >>= 1

    print(ans)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 142940
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()

int p[4][4];

int main() {
  for(int i = 0;i < 3;i++) {
    int a,b;
    cin >> a >> b;
    a--;
    b--;
    p[a][b] = p[b][a] = 1;
  }

  vector<int> v = {0,1,2,3};

  do {
    bool ok = true;
    rep(i,0,2) {
      ok =  ok && (p[v[i]][v[i + 1]]);
    }
    if(ok) {
      cout << "YES" << endl;
      return 0;
    }
  } while(next_permutation(all(v)));
  cout << "NO" << endl;
}


Measured memory_bytes: 256
using System;

class Plasticboard
{
    public static void Main()
    {
        int n = 0;
        int m = 0;
        while (true)
        {
            var input = Console.ReadLine();
            if (string.IsNullOrEmpty(input)) break;
            var s = input.Split(',');
            var a = Array.ConvertAll(s, int.Parse);
            if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) n++;
            if (a[0] == a[1] && 2 * a[0] > a[2]) m++;
        }
        Console.WriteLine("{0}\n{1}", n, m);
    }
}

Measured memory_bytes: 8980
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string.h>
using namespace std;
int main(){
	int a[3],d;
	cin>>a[0]>>a[1]>>a[2]>>d;
	sort(a,a+3);
	for(int i=0;i<d;i++){
		a[2]=a[2]*2;
	}
	cout<<a[0]+a[1]+a[2]<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define MOD (1000000007)
#define vi vector<int>
#define vl vector<ll>
#define vb vector<bool>
#define vvi vector<vi>
#define vvl vector<vl>
#define pii pair<int, int>
#define pli pair<ll, int>a
#define pb push_back

#define mp make_pair
#define all(a) (a).begin(),(a).end()

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

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

ll keta(ll n){
  string s = to_string(n);
  ll num = s.size();
  return num;
}

const ll INF = 1LL << 60;

const int dh[4] = {1,0,-1,0};
const int dw[4] = {0,1,0,-1};

struct Edge{
  int to;
  int weight;
  Edge(int t, int w) : to(t), weight(w){}
};
using Graph = vector<vector<Edge>>;
using P = pair<ll, int>;

class UnionFind{
public:
  vi Parent;

  // 宣言と同時に Parent を初期化
  UnionFind(int n){
    Parent = vi(n,-1);
  }

  int root(int a){
    if(Parent[a] < 0) return a;
    return Parent[a] = root(Parent[a]);
  }

  int size(int a){
    return -Parent[root(a)];
  }

  bool issame(int a, int b){
    return root(a) == root(b);
  }

  bool merge(int a, int b){
    a = root(a);
    b = root(b);

    if(a == b) return false;

    if(a < b) swap(a,b);
    Parent[a] += Parent[b];
    Parent[b] = a;

    return true;
  }
};

int main(){
  int n,m; cin >> n >> m;
  vi a(m),b(m);
  rep(i,m){
    cin >> a[i] >> b[i];
    a[i]--; b[i]--;
  }

  int ans = 0;
  
  rep(i,m) {
    UnionFind Uni(n);
    rep(j,m) {
      if(i == j) continue;
      Uni.merge(a[j], b[j]);
    }
    if(Uni.size(0) < n) ans++;
  }

  cout << ans << endl;
}

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

using namespace std;
using ll = long long;
using ld = long double;

void solve(ll A, ll B) {
  int amin = ceil(A/0.08);
  int amax = ceil((A+1)/0.08);
  int bmin = ceil(B/0.1);
  int bmax = ceil((B+1)/0.1);

  int ans = -1;
  if (amin <= bmin) {
    if (bmin < amax) ans=bmin;
  } else {
    if (amin< bmax) ans=amin;
  }
  cout << ans << endl;
}

int main() {
  ll A;
  cin >> A;
  ll B;
  cin >> B;
  solve(A, B);
  return 0;
}


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


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

}









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

if a >= b and a >= c:
    print(a * pow(2, k) + b + c)
elif b >= a and b >= c:
    print(b * pow(2, k) + a + c)
else:
    print(c * pow(2, k) + b + a)


Measured memory_bytes: 3060
n=int(input())
import collections
d=collections.defaultdict(int)
for i in range(n):
    d[input()]+=1
m=0
ans=[]
for i,j in d.items():
    if j>m:
        ans=[i]
        m=j
    elif j==m:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

Measured memory_bytes: 32488
N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = [False] * (10 ** 5 + 10)
for i in range(1, K+1):
    dp[i] = not all(dp[i-a] if i-a >= 0 else True for a in A)

print("First" if dp[K] else "Second")



Measured memory_bytes: 43228
#include<bits/stdc++.h>
using namespace std;
int main(){

  int n,m;
  int a[1001];
  int u=0,w=0;

  cin >> n;
  for(int i = 0;i < n;i++){
    cin >> m;

    for(int j = 0;j < m;j++){
      cin >> a[j];
      if(j == 0) continue;
      if(a[j]>a[j-1]) u = max(u,a[j]-a[j-1]);
      else if(a[j] < a[j-1]) w = max(w,a[j-1]-a[j]);
    }
  
    cout << u << ' ' << w << endl;
    u = 0;
    w = 0;
  }

  return (0);
}

Measured memory_bytes: 3080
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <iomanip>	
#include <deque>
#include <set>
#include <climits>
#include <memory>
#include <numeric>
#include <utility>


#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
#define fore(i,a) for(auto &i:a)
#define INF INT_MAX/2;
#define PI 3.14159265358979323846264338327950L;
const int INF2 = 1001001001;
typedef long long ll;
using namespace std;
using vi = vector<int>;
using vll = vector<ll>;
ll mod = 1e9 + 7;
//ll llmax = 10000000000000000000ll;
using namespace std;
using Graph = vector<vector<int>>;



int cnt_digit(ll N)
{
	int digit = 0;

	while (N > 0)
	{
		N /= 10;
		digit++;
	}
	return digit;
}


 // 最大公約数計算
 
ll gcd(ll a, ll b)
{
	if (b == 0) {
		return a;
	}
	else {
		return gcd(b, a % b);
	}
}
// 最小公倍数の計算

ll lcm(ll a, ll b)
{
	ll g = gcd(a, b);

	return a / g * b;
}

struct union_find
{
	vector<int> par, r;
	union_find(int n)
	{
		par.resize(n);
		r.resize(n);
		init(n);
	}


	void init(int n)
	{
		for (int i = 0; i < n; i++) par[i] = i;
		for (int i = 0; i < n; i++) r[i] = 0;
	}

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

	void unite(int x, int y)
	{
		x = find(x);
		y = find(y);

		if (r[x] < r[y])
		{
			par[x] = y;
		}
		else
		{
			par[y] = x;
			if (r[x] == r[y])
			{
				r[x]++;
			}
		}
	}
};

const int MAX_N = 110000;

int memo[MAX_N];

int rec(int n) {
	if (n == 0)return 0;
	if (memo[n] != -1)return memo[n];

	int res = n;

	for (int pow6 = 1; pow6 <= n; pow6 *= 6)res = min(res, rec(n - pow6) + 1);

	for (int pow9 = 1; pow9 <= n; pow9 *= 9)res = min(res, rec(n - pow9) + 1);

	return memo[n] = res;
}

int calc(int x) {
	int ret = 0;
	while (x % 2 == 0) {
		x /= 2;
		ret++;
	}

	return ret;
}

int a[12][12];
int D;
ll G;
vector<ll> P, C;

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

	cin >> a;
	string ans = "No";
	rep(i, 0, a / 4 + 1) {
		rep(j, 0, a / 7 + 1) {
			if (i * 4 + j * 7 > a)continue;
			if (i * 4 + j * 7 == a) {
				ans = "Yes";
				break;
			}

		}
	}
	cout << ans << endl;
	/*int N;
	cin >> N;
	string ans = "";
	while (N != 0) {
		if (N % 2 != 0) {
			N--;
			ans = "1" + ans;
		}
		else ans = "0" + ans;
		N /= -2;
	}
	if (ans == "")ans = "0";
	cout << ans << endl;*/

}
	

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


int main(){
	int N,a,ans=0; cin >> N;
	for(int i=0; i<N; i++){
		cin >> a;
		ans+=a;
	}cout << ans-N << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9+7;
#define REP(i,j,n) for(int i=j;i<n;i++)
#define rep(i,n) REP(i,0,n)


// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int x;
    cin >> x;

    int gcd = __gcd(x, 360);
    cout << 360/gcd << endl;
}


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

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

    if (n % 2 == 1) {
        cout << "No" << endl;
        return 0;
    }

    string t = s.substr(0, n / 2);
    if (s == t + t) cout << "Yes";
    else cout << "No";

    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　 |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/



int N, Q, A[101010];
int L[101010], R[101010];
int top, last;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N >> Q;
    rep(i, 0, N) cin >> A[i];
    rep(i, 0, N) A[i]--;

    if (N == 1) {
        printf("1\n");
        return;
    }

    top = A[0];
    last = A[N - 1];
    rep(i, 0, N) {
        if (i) L[A[i]] = A[i - 1];
        else L[A[i]] = -1;

        if (i + 1 < N) R[A[i]] = A[i + 1];
        else R[A[i]] = -1;
    }

    rep(_, 0, Q) {
        int q; cin >> q; q--;

        if (q == top) {
            top = R[q];
            L[top] = -1;
            R[last] = q;
            L[q] = last;
            R[q] = -1;
            last = q;
        }
        else if (q == last) {
            last = L[q];
            R[last] = -1;
            L[top] = q;
            R[q] = top;
            L[q] = -1;
            top = q;
        } else {
            int nxtop = R[q];
            int nxlast = L[q];

            L[q] = last;
            R[q] = top;

            L[nxtop] = -1;
            R[nxlast] = -1;

            L[top] = q;
            R[last] = q;

            top = nxtop;
            last = nxlast;
        }
    }

    int f = 1;
    rep(i, 0, N) if (L[i] < 0) top = i;
    while (0 <= top) {
        if (f) f = 0;
        else printf(" ");

        printf("%d", top + 1);
        top = R[top];
    }
    printf("\n");
}


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

int main()
{
	int n; cin >> n;
	vector<int>Alp(26, 100);
	for (int i = 0; i < n; i++) {
		string s; cin >> s;
		vector<int>cnt(26);
		for (int j = 0; j < s.size(); j++) {
			cnt[s[j] - 'a']++;
		}

		for (int j = 0; j < 26; j++) {
			Alp[j] = min(Alp[j], cnt[j]);
		}
	}

	for (int j = 0; j < 26; j++) {
		for (int k = 0; k < Alp[j]; k++) {
			cout << char('a' + j);
		}
	}
	cout << endl;

    return 0;
}



Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	static int VMAX = 10000;
	public static void main(String[] args) throws IOException {
		new Main().run();
	}
	public void run() throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		int[] A = new int[n+1];
		int[] B = new int[n+1];
		int[] C = new int[VMAX+1];
		StringTokenizer st = new StringTokenizer(reader.readLine());
		reader.close();
		for (int i = 0; i < n; i++) {
			A[i+1] = Integer.parseInt(st.nextToken());
			C[A[i+1]]++;
		}
		
		for (int i = 1; i <= VMAX; i++) C[i] += C[i-1];
		
		for (int i = n; i >= 1; i--) {
			B[C[A[i]]] = A[i];
			C[A[i]]--;
		}
		
		StringBuilder sb = new StringBuilder();
		sb.append(B[1]);
		for (int i = 2; i <= n; i++) {
			sb.append(" " + B[i]);
		}
		System.out.println(sb.toString());
	}
}



Measured memory_bytes: 198904
import sys
from itertools import accumulate

input = sys.stdin.readline


def binary_search(a, key):
    """Meguru type binary search"""
    ok = -1
    ng = len(a)

    while (ng - ok > 1):
        mid = (ok + ng) // 2
        if a[mid] <= key:
            ok = mid
        else:
            ng = mid

    return ok


def main():
    N, M, K = map(int, input().split())
    A = tuple(map(int, input().split()))
    B = tuple(map(int, input().split()))

    B_cumsum = tuple(accumulate(B))
    ans = 0
    time = 0
    for i in range(N + 1):
        if time > K:
            break
        j = binary_search(B_cumsum, K - time) + 1
        if ans < i + j:
            ans = i + j
        if i < N:
            time += A[i]

    print(ans)


if __name__ == "__main__":
    main()


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

int main() {
  int h,w;
  int k;
  cin >> h >> w >> k;
  int ans = 0;

  vector<vector<char>> board(h, vector<char>(w));
  rep(i, h) {
    rep(j, w) {
      char c;
      cin >> c;
      board[i][j] = c;
    }
  }

  auto is_k = [&](int hmask, int wmask) {
    int cnt = 0;
    for(int y=0;y<h;y++) {
      for(int x=0;x<w;x++) {
        if(hmask & (1<<y)) {
          continue;
        }
        if(wmask & (1<<x)) {
          continue;
        }
        if(board[y][x] == '#') {
          cnt++;
        }
      }
    }
    return cnt == k;
  };

  for(int hmask=0;hmask<(1<<h);hmask++) {
    for(int wmask=0;wmask<(1<<w);wmask++) {
      if(is_k(hmask, wmask)) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3628
T=input()
T_len=len(T)
S=list(T)
if S[0]=="?":
    S[0]="D"
if S[-1]=="?":
    S[-1]="D"

for i in range(T_len):
    if S[i]=="?":
        if S[i-1]=="D" and (S[i+1]=="D" or S[i+1]=="?"):
            S[i]="P"
        else:
            S[i]="D"
str_changed = "".join(S)
print(str_changed)

Measured memory_bytes: 10920
#include<stdio.h>
int main()
{
	int N,K,X,Y;
	scanf("%d%d%d%d",&N,&K,&X,&Y);
	if(N<=K) printf("%d\n",N*X);
	else printf("%d\n",(N-K)*Y+K*X);
	return 0;
}

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

using namespace std;
using ll = unsigned long long;
const ll MOD = 1000003;

ll gcd(ll a, ll b) {
    if (a < b) return gcd(b, a);
    if (b == 0) return a;

    return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}

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

    ll ans = 0;
    for (int i = 0; i < n; ++i) {
        ll data;
        cin >> data;
        if (i == 0) {
            ans = data;
            continue;
        }
        ans = lcm(ans, data);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
 int h,w;
 cin >> h >> w;
 for(int i = 0; i < w +2;i++){
 	cout << '#';
    }
 cout << endl;
for(int i=0;i < h;i++){
    cout << '#';
   for(int i=0;i < w;i++){
	char s;
	cin >> s;
	cout << s;
        }
    cout << '#' << endl;
 }
for(int i = 0; i < w +2;i++){
 	cout << '#';
    }
 cout << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iomanip>
#define MAX 100001
#define EPS (1e-2)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29) 
using namespace std;
double dp[MAX][10];
double pr[MAX];
double f[10];
int main()
{
  int n;
  
  f[0] = 1;
  REP(i,1,10)f[i] = f[i-1]/2;
  rep(i,MAX)rep(j,10)dp[i][j] = 0;
  dp[0][0] =  1;
  double sum = 0;

  REP(i,0,MAX-1)
    {
      rep(j,min(i+1,10))
	{
	  if(dp[i][j] == 0)continue;
	  if(j == 0)
	    {
	      dp[i+1][j+1] += dp[i][j];
	      sum += dp[i][j];
	      continue; 
	    }
	  dp[i+1][0]   += dp[i][j] * (1 - f[j]);
	  dp[i+1][j+1] += dp[i][j] * f[j];
	  sum += dp[i][j] * f[j];
	}      
      pr[i] = sum;
    }

  while(cin >> n,n)cout << setiosflags(ios::fixed) << setprecision(8) << pr[n-1] << endl;  
    
  
  return 0;
}

Measured memory_bytes: 9824
#include <iostream>
#include <algorithm>
#include <vector>
#define MAX 200002
#define fi first
#define se second
typedef long long ll;
 
using namespace std;

vector<vector<int>> wait(26);
vector<vector<int>> aut(100000);
int main(){
	for(int i=0;i<100000;i++){
		aut[i].resize(26);
		for(int j=0;j<26;j++){
			aut[i][j] = -1;
		}
	}
	string s;
	string t;
	cin >> s >> t;
	int len_s = s.size();
	for(int i=0;i<2*len_s;i++){
		for(auto elem: wait[s[i % len_s]-'a']){
			aut[elem][s[i % len_s]-'a'] = i % len_s;
		}
		wait[s[i % len_s]-'a'].clear();
		if(i < len_s){
			for(int j=0;j<26;j++){
				wait[j].push_back(i);
			}
		}
	}
	long long ans = 0;
	int curState = s.size()-1;
	for(auto i:t){
		if(aut[curState][i-'a'] == -1){
			cout << -1;
			return 0;
		}
		ans += (aut[curState][i-'a'] - curState + s.size() - 1) % s.size() + 1;
		curState = aut[curState][i-'a'];
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 24380
li_1 = list(map(int, input().split()))
li_2 = list(map(int, input().split()))
li_3 = list(map(int, input().split()))
n = int(input())
b = [int(input()) for i in range(n)]

index = 0
ans = 'No'

for i in b:
    for j in li_1:
        if i == j:
            li_1[index] = 0
        index += 1
    index = 0
for i in b:
    for j in li_2:
        if i == j:
            li_2[index] = 0
        index += 1
    index = 0
for i in b:
    for j in li_3:
        if i == j:
            li_3[index] = 0
        index += 1
    index = 0

if li_1[0] == 0 and li_1[1] == 0 and li_1[2] == 0:
    ans = 'Yes'
if li_2[0] == 0 and li_2[1] == 0 and li_2[2] == 0:
    ans = 'Yes'
if li_3[0] == 0 and li_3[1] == 0 and li_3[2] == 0:
    ans = 'Yes'

if li_1[0] == 0 and li_2[0] == 0 and li_3[0] == 0:
    ans = 'Yes'
if li_1[1] == 0 and li_2[1] == 0 and li_3[1] == 0:
    ans = 'Yes'
if li_1[2] == 0 and li_2[2] == 0 and li_3[2] == 0:
    ans = 'Yes'

if li_1[0] == 0 and li_2[1] == 0 and li_3[2] == 0:
    ans = 'Yes'
if li_1[2] == 0 and li_2[1] == 0 and li_3[0] == 0:
    ans = 'Yes'

print(ans)

Measured memory_bytes: 3444
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::f64::consts::*;

#[allow(unused)]
const INF: usize = std::usize::MAX / 4;
#[allow(unused)]
const M: usize = 1000000007;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),* $(,)*) => {
        #[cfg(debug_assertions)]
        eprintln!(concat!($("| ", stringify!($a), "={:?} "),*, "|"), $(&$a),*);
    };
}

pub fn modpow(x: usize, y: usize, m: usize) -> usize {
    let mut result = 1;
    let mut a = x;
    let mut b = y;
    while b > 0 {
        if b % 2 == 1 {
            result = result * a % m;
        }
        a = a * a % m;
        b /= 2;
    }
    result
}

fn main() {
    input! {
        n: usize,
    }
    if n < 2 {
        println!("0");
        return;
    }
    let x = modpow(10, n, M);
    let y = modpow(9, n, M);
    let z = modpow(8, n, M);
    println!("{}", ((x + M - (2 * y) % M) % M + z) % M);
}


Measured memory_bytes: 2180
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
    def same_check(self, x, y):
        return self.find(x) == self.find(y)
    
n,m = (int(i) for i in input().split())
uf = UnionFind(n-1)
for i in range(m):
  a,b = (int(i) for i in input().split())
  if a == 1 or b ==n: uf.union(a-1,b-1)

if uf.same_check(0,n-1): print('POSSIBLE')
else:print('IMPOSSIBLE')

Measured memory_bytes: 12592
#include <stdio.h>
int main(){
	int n;
	int a[1000];
	int t;
	int i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	for(i=n-1;i>=0;i--){
		printf("%d",a[i]);
		if(i!=0) printf(" ");
	}
	printf("\n");
	return 0;
}


Measured memory_bytes: 2088
N, Y = map(int, input().split())

for i in range(N+1):
	for j in range(N - i + 1):
		if i*10000 + j*5000 + (N-i-j)*1000 == Y:
			print(i, j, N-i-j)
			exit()
print("-1 -1 -1")


Measured memory_bytes: 2940
#include <stdio.h>

int min(int a,int b){
	if(a<b){return a;}else{return b;}
}

int main(void){
	int a,b;

	scanf("%d %d",&a,&b);
	if(a<=0 && b>=0){
		printf("Zero\n");
	}else if(a>0){
		printf("Positive\n");
	}else if((min(b,-1)-a+1)%2==0){
		printf("Positive\n");
	}else{
		printf("Negative\n");
	}
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  string S;
  cin >> N >> S;
  int res = 0;
  for (int i = 0; i < 1000; i++){
    string p;
    if (i < 10){
      p[0] = '0';
      p[1] = '0';
      p[2] = to_string(i)[0];
    } else if (i < 100){
      p[0] = '0';
      p[1] = to_string(i)[0];
      p[2] = to_string(i)[1];
    } else {
      p = to_string(i);
    }
    int c = 0;
    for (int j = 0; j < N; j++){
      if (c == 0 && S[j] == p[0]){
        c++;
      } else if (c == 1 && S[j] == p[1]){
        c++;
      } else if (c == 2 && S[j] == p[2]){
        c++;
        break;
      }
    }
    if (c == 3) res++;
  }
  cout << res;
}

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


int main()
{
    string s;cin>>s;
    vector<int> a('z'-'a'+1, 0);
    for(int i = 0; i < (int)a.size(); i++){
        a[s[i]-'a']++;
    }
    for(int i = 0; i<'z'-'a' + 1; i++){
        if(a[i] > 1) {
            cout << "no" << endl;
            return 0;
        
        }
    
    }
    cout << "yes" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define rrep(i,a) for(int i=(int)a-1;i>=0;--i)
#define REP(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RREP(i,a,b) for(int i=(int)a-1;i>=b;--i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n) / gcd(n, m)*abs(m);//gl=xy
}
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
using namespace std;

vector<int>visited;
vector<int>d,f;
int cnt;

void dfs(int v,vector<vector<int>> &g){
  if(!visited[v])visited[v]=1,d[v]=++cnt;
  for(auto x:g[v]){
    if(visited[x]==0){
      dfs(x,g);
    }
  }
  visited[v]=2;
  f[v]=++cnt;
}

void solve(){
  int n;
  cin>>n;
  cnt=0;
  visited.resize(n);
  d.resize(n);f.resize(n);
  vector<vector<int>>g(n);
  rep(i,n){
    int u;
    cin>>u;
    u--;
    int k;
    cin>>k;
    int v;
    rep(j,k){
      cin>>v;
      v--;
      g[u].pb(v);
    }
  }
  rep(i,n){
    if(!visited[i])dfs(i,g);
  }
  rep(i,n){
    cout<<i+1<<" "<<d[i]<<" "<<f[i]<<"\n";
  }
}

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



Measured memory_bytes: 3192
import java.io.*;
import java.lang.*;
import java.util.*;
public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String[] str=br.readLine().split(" ");
        long N=Long.parseLong(str[0]);
        long K=Long.parseLong(str[1]);
        long ans=0;
        N=N%K;
        if(N==0) ans=0;
        else  ans=Math.min(K-N,N);
        System.out.println(ans);
    }
}

Measured memory_bytes: 21332
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;

int main(){
    int a, b;
    cin >> a >> b;
    if(a >= 13){
        cout << b;
    }
    else if(a >= 6 && a <= 12){
        cout << b/2;
    }
    else{
        cout << 0;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007
#define all(v)  v.begin(),v.end()
#define pb push_back
#define size(v)  (int) v.size()
#define fast ios_base:: sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
ll power_mod(ll a,ll x){if(x==0) return 1;ll y=power_mod(a,x/2);ll ans=(y*y)%mod; if(x%2) ans=(ans*a)%mod;return ans;}
ll inv(ll a){return power_mod(a,mod-2);}    
ll power(ll a, ll x){ if(x==0) return 1; ll y= power(a,x/2); ll ans=(y*y); if(x%2) ans*=a; return ans;}

int main(){

ll n,k,s;
cin>>n>>k>>s;

for(int i=0;i<k;i++) cout<<s<<" ";
for(int i=k;i<n;i++) {if(s==1e9)cout<<s-1<<" "; else cout<<s+1<<endl;}
cout<<endl;

}

Measured memory_bytes: 1280
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 20000;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    if (b <= c || d <= a) PRINT(0);
    else PRINT(min(b,d)-max(a,c));
}

Measured memory_bytes: 256
// atcoder/abc085/B/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

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

  int n;
  while (cin >> n) {
    vector<int> a(n);
    cin >> a;
    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
    cout << a.size() << endl;
  }

  return 0;
}


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


int main(){
	int a,b;
	while(cin>>a>>b){
		vector<int> road(102,0);
		road[a]++;
		road[b]++;
		while(1){
		cin>>a>>b;
		if(a==0)break;
		road[a]++;
		road[b]++;
		}
		bool flag = true;
	for(int i=1;i<102;i++){
		if((i>=3&&road[i]%2==1)||(i<=2&&road[i]%2==0)){
			flag = false;
			cout<<"NG"<<endl;
			break;
		}
	}

	if(flag)cout<<"OK"<<endl;
	}


	return 0;
}



Measured memory_bytes: 3076
#include <bits/stdc++.h>
#define endl '\n'
#define fo(i,n) for(i=0;i<n;++i)
#define forr(i,n) for(i=n-1;i>=0;--i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;

ll gcd(ll a,ll b){while(a&&b)a>b?a%=b:b%=a;return a+b;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

char a[10][10];
int h, w;
bool isvisited[10][10];

bool possible(int x, int y){
    isvisited[x][y] = 1;
    if(x==h-1 && y==w-1)
        return 1;
    if(a[x][y+1]=='#')
        return possible(x,y+1);
    if(a[x+1][y]=='#')
        return possible(x+1,y);
    return 0;
}

int main(){
    ios_base::sync_with_stdio(false);cout.tie(NULL);
    int i, j;
    cin>>h>>w;
    fo(i,h)
        fo(j,w)
            cin>>a[i][j];
    if(a[0][0]!='#' || a[h-1][w-1]!='#'){
        cout<<"Impossible"<<endl;
        return 0;
    }

    fo(i,10)
        fo(j,10)
            if(a[i][j]=='#')
                isvisited[i][j] = 0;
            else
                isvisited[i][j] = 1;

    int p = possible(0,0);
    if(p){
        fo(i,10)
            fo(j,10)
                if(isvisited[i][j]==0){
                    cout<<"Impossible"<<endl;
                    return 0;
                }
        cout<<"Possible"<<endl;
    }
    else
        cout<<"Impossible"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10, INF = 1e9 + 10;
inline int read() {
	char c = getchar(); int x = 0, f = 1;
	while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * f;
}
int N, a[MAXN];
main() {
	N = read();
	for(int i = 1; i <= N; i++) a[i] = read();
	int mn = 0, mx = 0, num = 0;
	for(int i = 1; i <= N; i++) {
		if(!mn || (mn == a[i])) mn = a[i], num++;
		else if(!mx || (a[i] == mx)) mx = a[i];
		else {puts("No"); return 0;}		
	}
	if(mn > mx && (mx)) swap(mn, mx), num = N - num;
	if(!mx) {
		if((mn == N - 1) || (mn * 2 <= N)) puts("Yes");
		else puts("No");
	} else {
		if((mx == mn + 1) && (2 * (mx - num) <= N - num) && (mx - num > 0)) puts("Yes");
		else puts("No");
	}
	return 0;
}

Measured memory_bytes: 640