akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include <fstream>
#include <vector>
#include <algorithm>

typedef long long LL;

std::string getS(bool b[], int size);

using namespace std;
int main()
{
#ifdef LOCAL
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    int N;
    string S;
    cin >> N;
    cin >> S;
    
    vector<pair<bool ,bool>> p = {{true, true},{true,false},{false,true},{false,false}};
    for(auto iter:p){
        bool a[N];
        a[0] = iter.first;
        a[1] = iter.second;

        for(int i=2;i<N;i++){
            if(a[i-1]){
                if(S[i-1] == 'o')a[i] = a[i-2];
                else a[i] = !a[i-2];
            }
            else{
                if(S[i-1] == 'o')a[i] = !a[i-2];
                else a[i] = a[i-2];
            }
        }

        bool isRight = true;
        for(int i=1;i<N+1;i++){
            if(a[i%N]){
                if((S[i%N] == 'o') != (a[(i-1)%N] == a[(i+1)%N])){
                    isRight = false;
                }
            }
            else{
                if((S[i%N] == 'o') != (a[(i-1)%N] != a[(i+1)%N])){
                    isRight = false;
                }
            }
        }
        if(isRight){
            cout << getS(a, N) << endl;
            return 0;
        }
    }

    cout << -1 << endl;

    return 0;
}
string getS(bool b[], int size){
    string s;
    for(int i=0;i<size;i++){
        if(b[i])s += "S";
        else s += "W";
    }
    return s;
}

Measured memory_bytes: 896
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int tmpN = N;
		int tmpfN=0;
		int fN = 0;
		for (int i = 8; i >= 0; i--) {
			tmpfN = (int)Math.floor(tmpN / Math.pow(10, i));
			fN += tmpfN;
			tmpN -= (int)(tmpfN * Math.pow(10, i));
		}
		if(N%fN==0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

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

using namespace std;

bool isPrime(int num);

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

  int result = X++;
  while (!isPrime(result)) {
    result++;
  }

  cout << result << endl;

  return 0;
}


bool isPrime(int num) {
  if (num < 2) {
    return false;
  } else if (num == 2) {
    return true;
  } else if (num % 2 == 0) {
    return false;
  }

  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }

  return true;
}

Measured memory_bytes: 256
import bisect

def solve(n, k, a):
    s = [0] * (n+1)
    for i in range(n):
        s[i+1] = s[i] + a[i]
    D = {}
    for i in range(n+1):
        p = (s[i] - i) % k
        if not p in D:
            D[p] = []
        D[p].append(i)
    res = 0
    for vs in D.values():
        m = len(vs)
        for j, vj in enumerate(vs):
            i = bisect.bisect_left(vs, vj+k) - 1
            res += i - j
    return res

n, k = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, k, a))

Measured memory_bytes: 69384
n,k = map(int,input().split())
dic = {}

for i in range(n):
    a,b = map(int,input().split())
    if a not in dic:
        dic[a] = b
    else:
        dic[a] += b

dic2 = sorted(dic.items())
c = 0
for i in dic2:
    c += i[1]
    if c >= k:
        print(i[0])
        exit()




Measured memory_bytes: 14564
import sys
# import math
# import bisect
# import numpy as np
# from decimal import Decimal
# from numba import njit, i8, u1, b1 #JIT compiler
# from itertools import combinations, product
# from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

def Main():
    n = read_int()
    # P=2,3,...N-1,N,1
    # i=1,2,...N-2,N-1,N
    print(n*(n-1)//2)

if __name__ == '__main__':
    Main()

Measured memory_bytes: 9148
#include<bits/stdc++.h>
using namespace std;
#define Sheryang main
const int maxn=6e6+7;
typedef long long ll;
const ll mod=1e10+7;
ll read(){ll c = getchar(),Nig = 1,x = 0;while(!isdigit(c))c = getchar();if(c == '-')Nig = -1,c = getchar();while(isdigit(c))x = ((x<<1) + (x<<3)) + (c^'0'),c = getchar();return Nig*x;}
#define read read()

ll prime[maxn];
bool vis[maxn];
int cot;

void primeall(){
    memset(vis,true,sizeof(vis));
    for(int i=2;i<maxn;i++){
        if(vis[i]) prime[++cot]=i;
        for(int j=1;j<=cot && i*prime[j]<maxn;j++){
            vis[i*prime[j]]=false;
            if(i%prime[j]==0) break;
        }
    }
}

ll qpow(ll a,ll b){

    ll ans=1;
    while(b){
        if(b&1) ans=a*ans;
        a=a*a;
        b/=2;
    }
    return ans;
}

int Sheryang()
{
    primeall();
    ll n,p;
    n=read;
    p=read;

    if(n==1){
        printf("%lld\n",p);
        return 0;
    }

    ll ans=1;
    for(int i=1;i<=cot&&prime[i]*prime[i]<=p;i++){
        ll cot=0;
        while(p%prime[i]==0) p/=prime[i],cot++;
        if(cot>=n) ans*=qpow(prime[i],(cot/n));
    }

    printf("%lld\n",ans);
    return 0;
}






Measured memory_bytes: 10496
package main
import "fmt"
func main(){
    // Your code here!
    var (
        H int
        W int
        x int
        y int
        r int
    )
    fmt.Scan(&W, &H, &x, &y, &r)
    if x - r < 0 || x + r > W || y - r < 0 || y + r > H {
        fmt.Println("No")
    }else{
        fmt.Println("Yes")
        
    }
}



Measured memory_bytes: 1180
n, m = map(int, input().split(" "))

i1 = [ input() for i in range(n) ]
i2 = [ input() for i in range(m) ]

for i in range(0, n - m + 1):
    for j in range(0, n - m + 1):
        si = [ x[j:j + m] for x in i1[i:i + m] ]
        if si == i2:
            print("Yes")
            exit(0)
print("No")


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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  map<int,int> mp;
  int n;
  cin >> n;
  int a;
  for(int i=0;i<n;i++){
    cin >> a;
    mp[a]++;
  }
  int ans=0;
  for(auto it:mp){
    if(it.second%2) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4992
import java.util.Scanner;
import java.util.stream.IntStream;
class Main{
	static Scanner s=new Scanner(System.in);
	static int gInt(){return Integer.parseInt(s.next());}
	public static void main(String[]$){
		long x=gInt(),y=gInt(),z=gInt();
		System.out.println(
				IntStream.range(0,114514)
				.filter(i->x>=y*i+z*i+z)
				.max().getAsInt()
				);
	}
}

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

int main(){
    int n;
    cin >> n;
    bool isOver = false;
    __int128_t a = 1;
    const __int128_t INF = 1e18;
    ll b;
    rep(i, n){
        cin >> b;
        if(b == 0){
            cout(0);
            return 0;
        }
        if(!isOver){
            a *= b;
            if(a > INF) isOver = true;
        }
    }
    if(isOver) cout(-1);
    else cout((ll)a);
}


Measured memory_bytes: 3616
import sys
#import numpy as np

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

import itertools

def main():
    N, M = i2nn()
    KS = ii2nnn(M)
    P = i2nn()
    judges = [[] for _ in range(M)]
    for i, ks in enumerate(KS):
        p = P[i]
        k = ks[0]
        s = ks[1:]
        while True:
            if p > len(s):
                break
            for pattern in itertools.combinations(s, p):
                d = [-1] * N
                for j in s:
                    d[j-1] = 0
                for j in pattern:
                    d[j-1] = 1
                judges[i].append(d)
            p += 2
    #print(judges)
    L = 2 ** N
    n = 0
    for i in range(L):
        sw = getDigits(i, N)
        #print(sw)
        a = True
        for judge in judges:
            b = False
            for ju in judge:
                c = True
                for j, k in zip(sw, ju):
                    if k == -1:
                        continue
                    elif j == k:
                        continue
                    else:
                        c = False
                        break
                if c:
                    b = True
                    break
            if b == False:
                a = False
                break
        if a:
            n += 1
    print(n)

def getDigits(n, maxlen):
    digits = [0] * maxlen
    i = 0
    while True:
        digits[i] = n % 2
        i += 1
        n = int(n / 2)
        if n == 0 or i >= maxlen:
            break
    return digits

main()


Measured memory_bytes: 44636
using System;
using System.Collections.Generic;
class Program
{
    static void Main(string[] args)
    {
        new Program().Solve();
    }

    Scanner sc = new Scanner();
    void Solve()
    {
        int H = sc.NextInt();
        int W = sc.NextInt();
        char[][] map = new char[H][];
        for (int h = 0; h < H; h++) map[h] = sc.Next().ToCharArray();

        bool rulebase = true;
        for (int w = 0; w < W; w++)
        {
            bool through = false;
            int cnt = 0;
            for (int h = 0; h < H; h++)
            {
                if (through == false && map[h][w] == '#') 
                {
                    through = true;
                    cnt++;
                }
                else if (through == true && map[h][w] == '.')
                {
                    through = false;
                }
            }
            if (cnt >= 2) rulebase = false;
            if (rulebase == false) break;
        }
        for (int h = 0; h < H; h++)
        {
            bool through = false;
            int cnt = 0;
            for (int w = 0; w < W; w++)
            {
                if (through == false && map[h][w] == '#')
                {
                    through = true;
                    cnt++;
                }
                else if (through == true && map[h][w] == '.')
                {
                    through = false;
                }
            }
            if (cnt >= 2) rulebase = false;
            if (rulebase == false) break;
        }
        for (int w = 0; w < W - 1; w++)
        {
            for (int h = 0; h < H - 1; h++)
            {
                if (map[h][w] == '#' && map[h + 1][w] == '#' &&
                    map[h][w + 1] == '#' && map[h + 1][w + 1] == '#')
                {
                    rulebase = false;
                }
            }
            if (rulebase == false) break;
        }
            if (rulebase == true) wl("Possible");
            else wl("Impossible");
        rk();
    }
    
    // ------------------------------------- //
    void wl(string v) { Console.WriteLine(v); }
    void wl(int v) { Console.WriteLine(v); }
    void rk() { Console.ReadKey(); }
    int max(int v1, int v2) { return Math.Max(v1, v2); }
    int min(int v1, int v2) { return Math.Min(v1, v2); }
    long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); }
    long lcm(long a, long b) { return a / gcd(a, b) * b; }
}
class Scanner
{
    public Scanner() { }
    private string[] buff = null;
    private int bIndex = 0;
    public string Next()
    {
        if (buff == null || bIndex >= buff.Length)
        {
            buff = Console.ReadLine().Split(' ');
            bIndex = 0;
        }
        return buff[bIndex++];
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
}
class Pair<T, K>
{
    public Pair() { }
    public Pair(T f, K s)
    {
        first = f;
        second = s;
    }
    public T first {get; set;}
    public K second {get; set;}
}


Measured memory_bytes: 3032
#鈴木に教わった

S=str(input())
N=len(S)

ans=[]
for h in range(N):
    ans.append(0)
    
L=[]
count=0
for i in range(N-1):
    if S[i]==S[i+1]:
        count+=1
    else:
        L.append([S[i],count+1])
        count=0

L.append([S[N-1],count+1])

now=0
for j in range(len(L)):
    if L[j][0]=='R':
        now+=L[j][1]
        ans[now]+=L[j][1]//2
        ans[now-1]+=L[j][1]-L[j][1]//2
    else:
        ans[now-1]+=L[j][1]//2
        ans[now]+=L[j][1]-L[j][1]//2
        now+=L[j][1]

print(*ans)










Measured memory_bytes: 16504
#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>;

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

bool prime(ll n) {
  for (ll i = 2; i*i <= n; ++i) {
    if (n%i == 0) return false;
  }
  return true;
}


int main() {
  ll a, b;
  cin >> a >> b;
  ll c = gcd(a,b);
  ll ans = 0;
  for (ll i = 1; i*i <= c; ++i) {
    if (c%i == 0) {
      if (prime(i)) ans++;
      if (i!=c/i && prime(c/i)) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
    int N;
    cin >> N;
    vector<int64_t> L(N+1);
    L.at(0)=2;
    L.at(1)=1;
    for(int i=2;i<N+1;i++){
        L.at(i)=L.at(i-1)+L.at(i-2);
    }
    cout << L.at(N) << endl;
    return 0;
}

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

int main(){
    double n,k;
    cin >> n >> k;
    double sum = 0;
    double s = 0.5;
    for(int i = 1;i <= n;i++){
        double t = 1/n;
        int res = 0;
        int sum_1 = i;
        while(sum_1 < k){
            sum_1 *= 2;
            res++;
        }
        sum += t*pow(s,res);
    }
    cout << fixed  << setprecision(10) << sum << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>

using namespace std;

int otsuri();

int shiharai, daikin, otsuri_mai;
int money[4] = {10, 50, 100, 500};

int main()
{
	cin >> daikin;
	while(1){
		int sum_money = 0, sum_had_mai = 0;
		int had_mai[4], use_mai[4];
		for(int i = 0; i < 4; i++){
			cin >> had_mai[i];
			sum_money = money[i] * had_mai[i];
			sum_had_mai += had_mai[i];
		}
		int sum_have_mai, min_have_mai = 200;
		for(int i = 0; i <= had_mai[3]; i++){
			if(daikin <= 500 * (i - 1)) break;
			for(int j = 0; j <= had_mai[2]; j++){
				for(int k = 0; k <= had_mai[1]; k++){
					for(int l = 0; l <= had_mai[0]; l++){
						shiharai = 500 * i + 100 * j + 50 * k + 10 * l;
						if(shiharai >= daikin) {
							sum_have_mai = sum_had_mai;
							sum_have_mai -= i + j + k + l;
							otsuri_mai = otsuri();
							sum_have_mai += otsuri_mai;
							if(sum_have_mai < min_have_mai){
								min_have_mai = sum_have_mai;
								use_mai[3] = i;
								use_mai[2] = j;
								use_mai[1] = k;
								use_mai[0] = l;
							}
						}
					}
				}
			}
		}
		for(int i = 0; i < 4; i++){
			if(use_mai[i] != 0) cout << money[i] << ' ' << use_mai[i] << endl;
		}
		cin >> daikin;
		if(daikin == 0) break;
		else cout << endl;
	} 
	return 0;
}

int otsuri()
{
	int tsuri = shiharai - daikin;
	int cnt = 0;
	int mai = 0;
	for(int i = 3; i >= 0; i--){
		mai = tsuri / money[i];
		tsuri -= money[i] * mai;
		cnt += mai;
	}
	return cnt;
}

Measured memory_bytes: 1160
import java.util.*;
 
class Main {
        public static void main(String args[]) {
                int[] ans = new int[26];
                try (Scanner sc = new Scanner(System.in)) {
                        while (sc.hasNextLine()) {
                                String S = sc.nextLine();
                                for (int i = 0; i < S.length(); i++) {
                                        if (0 <= S.charAt(i) - 'a' && S.charAt(i) - 'a' < 26) {
                                                ans[S.charAt(i) - 'a']++;
                                        } else if (0 <= S.charAt(i) - 'A' && S.charAt(i) - 'A' < 26) {
                                                ans[S.charAt(i) - 'A']++;
                                        }
                                }
                        }
                }
                for (int i = 0; i < 26; i++) {
                        System.out.printf("%c : %d\n", i + 'a', ans[i]);
                }
        }
}


Measured memory_bytes: 26160
#include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
using namespace std;

struct start { start() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(10);
}; }start;

typedef long long ll;


int main(){
    int h,w;
    
    while(1){
        cin >> h >> w;
        if(h == 0 && w == 0) break;
        rep(i,0,h){
            rep(j,0,w){
                if(i == 0 || j == 0 || i == h-1 || j == w-1) cout << "#";
                else cout << '.';
                
            }
            cout << endl;
        }
        cout << endl;
    
    }
    
    
    return 0;
}


Measured memory_bytes: 3136
#include<iostream>
#include<string>

using namespace std;

int main(){
    string s,t,n;
    cin >> s >> t;
    int a,b;
    cin >> a >> b;
    cin >> n;
    if(n == s){
        a = a-1;
    }else{
        b = b-1;
    }
    cout << a << " "<< b << endl;
    return 0;
}

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm( a, b ) (a)/__gcd((a),(b))*(b)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;

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

vector< int > Div( int n ) {
    vector< int > ret;
    for( int i = 1; i * i <= n; ++i ) {
        if( n % i == 0 ) {
            ret.pb( i );

            if( i * i != n ) ret.pb( n / i );
        }
    }
    sort( all( ret ) );
    return ret;
}

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

    LL n, a, b;
    cin >> n >> a >> b;

    if( a == b ) {
        cout << 0 << endl;

    } else if( (b - a) % 2 == 0 ) {
        cout << (b - a) / 2 << endl;

    } else {
        LL cnt = n - b;
        LL ta = a;
        ta += (n - b);
        if( (n - ta) % 2 != 0 ) {
            ++ta;
            ++cnt;

        }
        cnt += (n - ta) / 2;

        LL ccnt = a - 1;
        b -= a - 1;
        if( (b - 1) % 2 != 0 ) {
            --b;
            ++ccnt;

        }
        ccnt += (b - 1) / 2;

        cout << min(cnt, ccnt) << endl;

    }
    return 0;
}



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

using namespace std;

inline int gi()
{
	int f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + (c ^ 48), c = getchar();
	return f * x;
}

int n, ans;
struct Node
{
	int x, l, y;
} a[100003];

inline bool cmp(Node x, Node y)
{
	return x.y < y.y;
}

int main()
{
	n = gi();
	for (int i = 1; i <= n; i+=1)
	{
		a[i].x = gi(), a[i].l = gi(), a[i].y = a[i].x + a[i].l;
	}
	sort(a + 1, a + 1 + n, cmp);
	int tmpp = -1000000007;
	for (int i = 1; i <= n; i+=1)
	{
		if (a[i].x - a[i].l >= tmpp)
		{
			++ans;
			tmpp = a[i].y;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <utility>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdlib>
 
using namespace std;
 
typedef long long int ll;
typedef vector<long long int> VL;
typedef vector<VL> VVL;
 
int main() {
    while(1) {
        string s;
        int m;
        cin >> s;
        if(s.compare("-") == 0) {
            break;
        }
        
        cin >> m;
        for(int i=0; i<m; i++) {
            int h;
            cin >> h;
            string move_s = s.substr(0, h);
            string new_s = s.substr(h, s.length() - h);
            new_s.append(move_s);
            s = new_s;
        }
        
        cout << s << endl;
    }
    
    return 0;
}



Measured memory_bytes: 3180
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        new Main();
    }

    public Main() {
        Scanner sc = new Scanner(System.in);
        int H = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int remainder = H % A;
        int n = H / A;
        System.out.println(remainder > 0 ? n + 1 : n);
    }
}


Measured memory_bytes: 21844
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, 1000000007)
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(Scanner())
	m, _ := strconv.Atoi(Scanner())
	a := make([]int, n)
	s := 0
	for i := 0; i < n; i++ {
		a[i], _ = strconv.Atoi(Scanner())
		s += a[i]
	}
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	d := s / (4 * m)
	if s%(4*m) != 0 {
		d += 1
	}
	f := true
	for i := 0; i < m; i++ {
		if a[i] < d {
			f = false
		}
	}
	if f {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


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

int ctoi(char);
int main(void){
	string S;
	double K;
	char ans='1';
	cin >> S;
	cin >> K;
	for(int i=0;i<K;i++){
		if(ctoi(S[i])>=2){
			ans=S[i];
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

int ctoi(char c){
	if(c >= '0' && c<= '9'){
		return c - '0';
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    long long int i, n, min, max, sum, input;
    
    cin >> n;
 
    sum = 0;
    min=1000000;
    max=-1000000;
    for(i=1; i<=n; i++)
    {
        cin >> input;
        if(input < min)
            min = input;
    
        if(input > max)
            max = input;
       
      
         sum = sum + input;
    }
    
    cout << min << " " << max << " " << sum << endl;
}


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

#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define each(it,v) for(auto &it : v)
#define all(v) (v).begin(),(v).end()
#define mod 1e9+7

using namespace std;
using vi = vector<int>;
using vl = vector<long>;
using P = pair<int,int>;

main()
{
        long n,m; cin>>n>>m;
        long ans=0;
        if(n*2>m)
        {
                ans+=m/2;
                cout<<ans<<endl;
                return 0;
        }

        ans+=n;
        m-=n*2;

        ans+=m/4;

        cout<<ans<<endl;

}

Measured memory_bytes: 256
#include <stdio.h>

int p[10001];

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

int main(void)
{
  	int i, n;
	int p[10001];
	for ( i= 0; i<10001; i++){
		p[i] = isprime(i);
	}
	 
	while(1){
		scanf("%d" , &n);
		if(n == 0)
			break;
		for(i = n ; i > 1;i--){
			if(p[i]*p[i -2] ==1)
				break;
		}
			if(n >= 5)
				printf("%d %d\n",i-2,i);
	}
		return 0;
}

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

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef array<int, 3> tri;
typedef long double ld;

template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;}
template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;}



void _main() {
        int n; cin >> n;
        vector<int> a(n); cin >> a;
        vector<int> pre(n + 2), suf(n + 2);
        for (int i = 1; i <= n; i++) {
                pre[i] = __gcd(pre[i - 1], a[i - 1]);
        }
        for (int i = n; i >= 1; i--) {
                suf[i] = __gcd(suf[i + 1], a[i - 1]);
        }

        int ans = 0;
        for (int i = 1; i <= n; i++) {
                ans = max(ans, __gcd(pre[i - 1], suf[i + 1]));
        }

        cout << ans;
}



signed main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int _t = 1;
//        cin >> _t;
        while (_t--) _main();
        return 0;
}


Measured memory_bytes: 4512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int n;
cin>>n;
double N=n;
if(n%2==0)cout<<fixed<<setprecision(10)<<(N/2)/N;
else cout<<fixed<<setprecision(10)<<(ceil(N/2.0)/N);
return 0;
}


Measured memory_bytes: 256
import sys
from collections import deque

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """

    def __init__(self, n_max, mod=10 ** 9 + 7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        if n < r:
            return 0
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n + 1):
            fac.append(fac[i - 1] * i % self.mod)
            facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n + 1)
        modinv[1] = 1
        for i in range(2, n + 1):
            modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod
        return modinv

    def comb_with_repetition(self, n, r):
        # 重複組み合わせ
        return self.__call__(n + r - 1, r)


def main():
    X, Y = map(int, input().split())
    if (X + Y) % 3 != 0:
        print(0)
        return
    else:
        if Y > 2 * X:
            print(0)
            return
        if 2 * Y < X:
            print(0)
            return

        comb = Combination(n_max=10 ** 6 + 1)
        n = (X + Y) // 3
        r = X - n
        ans = comb(n, r)

        print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 122176
#include <bits/stdc++.h>
#define fi first
#define se second
#define maxn 200003
#define mod 998244353
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int,int> pi;

int n,k;
int dp[maxn];
int sum[maxn];
int l[10],r[10];

int main() {
	scanf("%d%d",&n,&k);
	for( int i = 0 ; i < k ; i++ )
		scanf("%d%d",&l[i],&r[i]);
	dp[n] = 1;
	sum[n] = 1;
	for( int i = n-1 ; i >= 1 ; i-- ) {
		for( int j = 0 ; j < k ; j++ ) {
			int ll = min(i+l[j],n+1);
			int rr = min(i+r[j],n+1);
			int add = (sum[ll] - sum[rr+1] + mod) % mod;
			dp[i] = (dp[i] + add) % mod;
		}
		sum[i] = (sum[i+1] + dp[i]) % mod;
	}
	printf("%d\n",dp[1]);
	return 0;
}

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

int main() {
  	long long int A, V, B, W, T;
  	cin >> A >> V >> B >> W >> T;
  
  	long long int distance = abs(A - B);
  	bool flag = false;
  	if (V >= W){
      	if (V * T - W * T >= distance) flag = true;
    }
  
  	if (flag == true) cout << "YES" << endl;
  	else cout << "NO" << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
 
int main () {
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if(a+b>c+d){
    cout << "Left" ;
  }
  else if (a+b<c+d){
    cout << "Right" ;
  }
  else {
    cout << "Balanced" ;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n;
    static int a[];

    public static void main(String[] args) {
        read();
        output();
        solve();
    }

    public static void read() {
        n = sc.nextInt();
        a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
    }

    public static void solve() {
        for(int i=1;i<n;i++){
            int v = i;
            while(v>0) {
                if (a[v - 1] > a[v]) {
                    int tmp = a[v];
                    a[v] = a[v - 1];
                    a[v - 1] = tmp;
                }
                v--;
            }
            output();
        }
    }
    public static void output(){
        for(int i = 0;i<a.length;i++){
            System.out.print(a[i]);
            if(i+1<a.length){
                System.out.print(" ");
            }
        }
        System.out.println();
    }
}

Measured memory_bytes: 34168
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt() , b = sc.nextInt(), 
				c = sc.nextInt(), d = sc.nextInt();
		
		if(Math.min(b, d)-Math.max(a, c)>0) {
			System.out.print(Math.min(b, d)-Math.max(a, c));
		}
		else System.out.print("0");
	}

}

Measured memory_bytes: 23636
/*********************
*  Author: xuziyuan  * 
*********************/

#include <bits/stdc++.h>

#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define replet(c) for(char c='a';c<='z';c++) 
#define LL long long
#define pii pair <int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
#define sqr(a) ((a)*(a))

using namespace std;

const LL MOD=1e9+7;

int n,a,b;

int main()
{
	cin>>n>>a>>b;
	cout<<min(b,a*n)<<endl;
	rt0;
}

Measured memory_bytes: 256
def LI():
    return list(map(int, input().split()))


def LSH(h):
    return [list(input()) for _ in range(h)]


H, W, K = LI()
S = LSH(H)
ans = [[0 for i in range(W)]for j in range(H)]
count = 1
for i in range(H):
    itigo = 0
    ok = 0
    for j in range(W):
        if S[i][j] == "#":
            ok = 1
            if itigo == 0:
                ans[i][j] = count
                itigo = 1
            else:
                count += 1
                ans[i][j] = count

        else:
            ans[i][j] = count
    if ok == 0:
        ans[i][0] = 0
    else:
        count += 1
ok = -1
for i in range(H):
    if ans[i][0] == 0:
        if ok == -1:
            for k in range(i+1, H):
                if ans[k][0] != 0:
                    ok = k
                    break
        for x in range(W):
            print(ans[ok][x], end=" ")
        print()
    else:
        ok = i
        for j in range(W):
            print(ans[i][j], end=" ")
        print()


Measured memory_bytes: 13312
#include <bits/stdc++.h>
#include <stdlib.h>
#include <time.h> 
 
using namespace std;
long long mod = 1e9 + 7;
long long INF = 1e7;
double EPS = 1e-12;
typedef long long int lld;
long double tick(){static clock_t oldt; clock_t newt=clock();
    long double diff=1.0L*(newt-oldt)/CLOCKS_PER_SEC; oldt = newt; return diff; }
#define rep(i,a,n) for(long long int i = (a); i <= (n); ++i)
#define repI(i,a,n) for(int i = (a); i <= (n); ++i)
#define repD(i,a,n) for(long long int i = (a); i >= (n); --i)
#define repDI(i,a,n) for(int i = (a); i >= (n); --i)
inline lld sc() { lld a; scanf("%lld", &a); return a; }
inline int scd() { int a; scanf("%d", &a); return a; }
inline double scf() { double a; scanf("%lf",&a); return a; }
#define prL(a) printf("%lld\n",a)
#define prS(a) printf("%lld ",a)
#define prdL(a) printf("%d\n",a)
#define prdS(a) printf("%d ",a)
#define all(c) (c).begin(), (c).end()
#define sz(a) ((int)a.size())
#define Error(x...) { cout << "(" << #x << ")" << " = ( "; printIt(x); }
template <typename T1> void printIt(T1 t1) { cout << t1 << " )" << endl; }
template <typename T1, typename... T2>
void printIt(T1 t1, T2... t2) { cout << t1 << " , "; printIt(t2...); }
#define errorpair(a) cout<<#a<<" = ( "<<((a).first)<<" , "<<((a).second)<<" )\n";
#define mset(a, v) memset(a, v, sizeof(a))
#define popcount __builtin_popcountll

typedef pair<lld,lld> PA;

lld powP(lld x, lld y) {
    lld ans = 1, po = x % mod;
    while(y > 0) {
        if(y & 1) ans = ans * po % mod;
        y >>= 1; po = po * po % mod;
    }
    return ans;
}
 
bool bitSet(lld n, lld bit){
    if((n & (1LL << bit)) != 0) return true;
    else return false;
}
 
lld findGcd(lld a, lld b){
    while(a != 0) { lld temp = b % a; b = a; a = temp; }
    return b;
}

#define lim 300010
#define lim2 200010
#define qqqqqq 210
// Ab :)
// inline lld sqr(lld x) { return x * x; }
// unordered_map<lld,lld>::iterator it;
// std::ios::sync_with_stdio(false);
// priority_queue<PA> Q;
// lld dp[1<<18];

// vector<lld> G[lim];
// string S[lim];
// lld A[lim],B[lim],C[lim];

int main(){
    string S;
    cin >> S;
    S[1] = 'R' + 'B' - S[1];
    cout << S;
    return 0;
}


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

using namespace std;

#define ll long long

int N,K,tmp;
int Arr[5000];
int Vis[5000];
int Cost[5000];


void solve(){

   cin >> N >> K;

   for (int i = 0; i < N; i++)
   {
       cin >> tmp;
        tmp--;
       Arr[i] = tmp;
       Vis[i] = 0;
    }

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


    ll ans = -100000000000;

    int cur, curK, circsize;
    ll cmax, val;
    for (int i = 0; i < N; i++)
    {
        cur = i;
        val = Cost[Arr[cur]];
        cur = Arr[i];
        cmax = val;
        curK = K;
        circsize = 0;
        curK--;
        circsize++;

        while(cur != i && curK > 0){
            val += Cost[Arr[cur]];
            cur = Arr[cur];
            cmax = max(cmax,val);
            circsize++;
            curK--;
            
        }

        ans = max(ans, cmax);
        if(val > 0 && curK > 0)
        {
                ll tcmax = (K/circsize -1 ) * val;
                ans = max(ans, tcmax+cmax);
                tcmax += val;
                curK = (K % circsize);
                
                

                if(curK > 0){
                    cur = i;
                    val = Cost[Arr[cur]];
                    cur = Arr[i];
                    cmax = max(val,(ll)0);
                    circsize = 0;
                    curK--;

                    while(cur != i && curK > 0){
                        val += Cost[Arr[cur]];
                        cur = Arr[cur];
                        cmax = max(cmax,val); 
                        curK--;

                    }
                    tcmax = tcmax+cmax;
                }
                
                ans = max(ans, tcmax);
        }
    }
    cout << ans << endl;
}






int main(){

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

    solve();

}

Measured memory_bytes: 3716
#include<stdio.h>
int dp[31];
int main(){
	int n;
	int i,j;
	while(1){
		scanf("%d",&n);
		if(n==0)return 0;
                for(i=0;i<=n;i++)dp[i]=0;
		dp[0]=1;
		for(i=0;i<n;i++){
			for(j=1;j<=3;j++){
				if(i+j<=n)dp[i+j]+=dp[i];
			}
		}
		int ans;
		if(dp[n]%10==0)ans=dp[n]/10;
		else ans=(int)dp[n]/10+1;
		if(ans%365==0)printf("%d\n",ans/365);
		else printf("%d\n",(int)ans/365+1);
	}
	return 0;
}

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

using namespace std;

int main(){
	long long ans, zero, half, n, k;

	scanf("%lld%lld", &n, &k);

	zero = n / k;
	ans = zero * zero * zero;

	if (k % 2 == 0){
		half = (n + k / 2) / k;
		ans += half * half * half;
	}

	printf("%lld\n", ans);

	return 0;
}

Measured memory_bytes: 256
h, w = gets.split.map(&:to_i)
picture = []
picture << ("#" * (w + 2)).split("")
h.times do
  row = gets.chomp.split("")
  row.unshift("#")
  row.push("#")
  picture << row
end
picture << ("#" * (w + 2)).split("")
picture.each do |pic|
  puts pic.join
end


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

using namespace std;
int main(){

	int n, k;
	int min=-1;
	int sum=0;
	vector<int> h;

	cin>> n;
	cin>> k;

	h.resize(n);

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

	sort(h.begin(), h.end());

	//for(int i=0;i<n;i++) cout<< h[i] << "\n";//

	for(int i=0;i<n-k+1;i++){
//cout<< " " << h[i+k-1]-h[i] << "\n";//
		if(h[i+k-1]-h[i]<min || min==-1){
			min=h[i+k-1]-h[i];
//cout<< "  " << min << "\n";//
		}
	}

	cout<< min << "\n";

}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef vector<string> vs;
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
const double PI = acos(-1.0);

int main() {
    string s;
    cin >> s;
    int ans = 0;
    rep(i, s.size()) {
        int ret = 0;
        rep2(j, i, s.size()) {
            if (s[j] == 'A' || s[j] == 'C' || s[j] == 'T' || s[j] == 'G')
                ret++;
            else
                break;
        }
        ans = max(ans, ret);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3568
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

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

  int64_t N;
  cin >> N;
  // const int64_t L = static_cast<int64_t>(T.length());
  vector<int64_t> A(N);
  vector<int64_t> B(N, 0);
  for (int64_t i = 0; i < N; ++i) {
    cin >> A[i];
    int64_t parity = (N - i + 1) % 2 == 0 ? 1 : -1;
    B[0] += parity * A[i];
  }
  cout << B[0];
  for (int64_t i = 1; i < N; ++i) {
    B[i] = -B[i - 1] + A[i - 1] * 2;
    cout << " " << B[i];
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 2944
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void put(int x){
	if(x<0) {
		putchar('-');
		x*=-1;
	}
	if(x==0) {
		putchar('0');
	}
	int num=0;
	char c[15];
	while(x) {
		c[++num]=(x%10)+48;
		x/=10;
	}
	while(num) {
		putchar(c[num--]);
	}
	putchar('\n');
}
inline void in(int &x){
	char ch=getchar();
	int flag=1;
	while(!(ch>='0'&&ch<='9')) {
		if(ch=='-')
			flag*=-1;
		ch=getchar();
	}
	x=ch-'0';
	ch=getchar();
	while(ch>='0'&&ch<='9') {
		x=((x<<3)+(x<<1))+ch-'0';
		ch=getchar();
	}
	x*=flag;
}
int n;
int main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	in(n);
	if(n>=64)cout<<64<<endl;
	else if(n>=32)cout<<32<<endl;
	else if(n>=16)cout<<16<<endl;
	else if(n>=8)cout<<8<<endl;
	else if(n>=4)cout<<4<<endl;
	else if(n>=2)cout<<2<<endl;
	else if(n>=1)cout<<1<<endl;
	return 0;
}


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

signed main(){
  int A,B;
  cin>>A>>B;
  rep(i,B){
    if((A*i)%B==0){
      cout<<A*i<<endl;
      break;
    }
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
    int n;
	cin>>n;
	int ans = 0;
	while(n)
	{
		int a = n%10;
		if(a==7)
			ans = 1;
		n = n/10;
	}
	if(ans)
		cout<<"Yes";
	else
	{
		cout<<"No";
	}
	return 0;	
}

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

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  string s;
  cin>>s;
  string t;
  cin>>t;
int j=101;
  while(j--){
    
  for(int i=0;i<s.length()-1;i++){
       swap(s[i],s[i+1]);
  }
    
  if(s==t){
    cout<<"Yes";
    return 0;
  }

  }
  cout<<"No";
  return 0;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
const int mod=1000000007;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;cin >> n;
	vector<int> h(n),dp(n+1,1000000000);
	rep(i,n) cin >> h.at(i);
	dp[0]=0;
	rep(i,n){
		if(i-1>=0) dp[i]=min(dp[i],dp[i-1]+abs(h[i]-h[i-1]));
		if(i-2>=0) dp[i]=min(dp[i],dp[i-2]+abs(h[i]-h[i-2]));
	}
	cout << dp[n-1] << endl;
}


Measured memory_bytes: 1024
#include <iostream>

using namespace std;

int s[5000];

int main() {
  for (;;) {
    int n;
    cin >> n;
    if (!n) return 0;
    cin >> s[0];
    int r = s[0], m = 0;
    for (int i = 1; i < n; i++) {
      cin >> s[i];
      r = max(r, s[i]);
      s[i] += s[i-1];
    }
    for (int i = 0; i < n; i++)
      if (s[i] < m)
        m = s[i];
      else
        r = max(r, s[i]-m);
    cout << r << endl;
  }
}

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

int main(){
  int N,D,X;
  cin >> N >> D >> X;
  vector <int> A(N);
  Rep(i,N){ cin >>A.at(i); }
  
  int Result;
  
  Rep(i,N){
    Result += ( 1 + (D-1)/A.at(i) );
  }
  Result += X;
  cout << Result;
}


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

int main() {
  int N,A;
  cin >> N;
  int min_c = 50;
  for(int i=0; i<N; i++){
    int count = 0;
    cin >> A;
    while(A%2 == 0){
      A /= 2;
      count++;
    }
    if(count < min_c){
      min_c = count;
    }
  }
  cout << min_c << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main() {
  short sheep, wolf;
  char output[8];

  scanf("%hd %hd", &sheep, &wolf);

  if (sheep > wolf) {
    strcpy(output, "safe\n");
  } else {
    strcpy(output, "unsafe\n");
  }

  printf("%s", output);

  return 0;
}


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

int main(){

    int n;
    cin>>n;
    int a=n/1000;
    int b=(n%1000)/100;
    int c=(n%100) /10;
    int d=n%10;
    bool s=false;

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

    if(s){
      cout<<"Yes"<<endl;
    }else{
      cout<<"No"<<endl;
    }
    
    
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# 初期入力
import warnings
import numpy as np
import sys
from collections import OrderedDict
from scipy.sparse.csgraph import shortest_path
from scipy.sparse import (SparseEfficiencyWarning, csr_matrix)
warnings.simplefilter('ignore',SparseEfficiencyWarning)


nV, nE = map(int, input().split())
edges = [list(map(int, input().split())) for i in range(nE)]
freq = list(map(int, input().split()))
T_max = int(input())

far = sys.maxsize

# 隣接行列
l = np.zeros((nV+1,nV+1), dtype=np.int)
for edge in edges:
    l[edge[0]-1,edge[1]-1] = edge[2]
    l[edge[1]-1,edge[0]-1] = edge[2]
lw = l
# 疎行列
csr = csr_matrix(lw)
# 自己位置追加
csr[-1] = far
csr[-1] = np.where(csr[0].toarray() != 0, csr[0].toarray(), far)

orders = {}
loads = OrderedDict()
from_pos = 0
to_pos = 0
on_v = True
target_pos = 0
wait = 0
action = None

for t in range(T_max):

    ### judge ###
    N_new = int(input())
    new_orders = [list(map(int,input().split())) for i in range(N_new)]
    N_put = int(input())
    put_ids = [int(input()) for i in range(N_put)]
    #############

    print(-1, flush=True)

    ### judge ###
    verdict = input()
    if verdict == 'NG':
        sys.exit()

    N_achieve = int(input())
    achieve_ids = [int(input()) for i in range(N_achieve)]
    if t == T_max-1:
        sys.exit()
    #############

sys.exit()


Measured memory_bytes: 19000
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pii pair<int,int>
const long long MOD=1000000007;

int main(){
    int n,k,q;
    cin>>n>>k>>q;
    vector<int> AC(n,0);
    rep(i,q){
        int a;
        cin>>a;
        AC[a-1]++;
    }
    rep(i,n){
        int point=k-(q-AC[i]);
        if(point>0) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

int main()
{
    int k;
    cin >> k;
    string s;
    cin >> s;
    if (s.size() <= k) {
        cout << s << endl;
    } else {
        string t;
        for (int i = 0; i < k; i++) { t.push_back(s[i]); }
        cout << t << "..." << endl;
    }
    return 0;
}

Measured memory_bytes: 3132
x,y = map(int,input().split())
#if (2*x)<y:
z=y-(2*x) #12本足りない z=12
a=z/2 #a=6 亀に変身する鶴の数

if a<=x and a>=0 and z%2==0:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 9164
#include<iostream>
using namespace std;
int main(){
int a,b;

cin >> a >> b;
if(a<b){cout << "a < b" << endl;
}else if(a>b){cout << "a > b" << endl;
}else if(a==b){cout << "a == b" << endl;
}
return 0;
}


Measured memory_bytes: 3104
using System;
using System.Collections.Generic;
using System.Linq;
using static Atcoder;
using System.Threading.Tasks;
using System.ComponentModel;

public class Hello
{

    public static void Main()
    {
        int[] n = SpIntRead(' ');
        int cost = 0;
        int ans = int.MaxValue;
        cost = Math.Abs(n[2] - n[1]) + Math.Abs(n[1] - n[0]);
        if (cost < ans) ans = cost;
        cost = Math.Abs(n[2] - n[0]) + Math.Abs(n[0] - n[1]);
        if (cost < ans) ans = cost;
        cost = Math.Abs(n[1] - n[0]) + Math.Abs(n[0] - n[2]);
        if (cost < ans) ans = cost;
        cost = Math.Abs(n[1] - n[2]) + Math.Abs(n[2] - n[0]);
        if (cost < ans) ans = cost;
        cost = Math.Abs(n[0] - n[1]) + Math.Abs(n[1] - n[2]);
        if (cost < ans) ans = cost;
        cost = Math.Abs(n[0] - n[2]) + Math.Abs(n[2] - n[1]);
        if (cost < ans) ans = cost;
        Console.WriteLine(ans);
    }
}


public class Atcoder
{
    static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
    public static int LCM(int a, int b)
    {
        int c = a * b;
        if (a < b) Swap(ref a, ref b);
        int d = a % b;
        while (d != 0)
        {
            a = b;
            b = d;
            d = a % b;
        }
        return c / b;
    }
    public static string strReverce(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static int intRead()
    {
        return int.Parse(Console.ReadLine());
    }
    public static bool IsPrime(int n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        //double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i < n; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
    public static string[] SpRead(char c)
    {
        return Console.ReadLine().Split(c);
    }
    public static int[] SpIntRead(char c)
    {
        return Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
    }

}


Measured memory_bytes: 13268
function main()
  
  (N,M) = map(x -> parse(Int,x), split(readline()))
  n = zeros(N)
  road = zeros(M,2)
  
  for i in 1:M
    
    road[i,:] = map(x -> parse(Int,x), split(readline()))
    
  end
  
  for i in 1:M
    for j in 1:N
      
      if in(j,road[i,:])
        n[j] += 1
      end
      
    end
  end
  
  for i in 1:N
    
    println(Int(n[i]))
    
  end
  
end

main() 

Measured memory_bytes: 115444