akhauriyash/Code-Regression huggingface dataset:
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "


// CHECK THE LIMITS
typedef long long ll;

const int MOD = 1000000007;
const ll INFLL = 1e18;
const int INF = 1e9;
const int NMAX = 3005;

int gcd(int a, int b) {
  return b ? gcd(b, a%b) : a;
} 


ll dp[NMAX][NMAX];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin >> n;
    vector<int> a(n);

    for(int i= 0; i< n; ++i)
    {
        cin >> a[i];
    }
    // dp[0][n-1]

    for(int L = n-1; L >= 0; --L)
    {
        for(int R = L; R < n; ++R)
        {
            if(L==R)
            {
                dp[L][R] = a[L];
            }
            else
                dp[L][R] = max(a[L] - dp[L+1][R], a[R] - dp[L][R-1]);
        }
    }
    cout << dp[0][n-1];


    return 0;
}

Measured memory_bytes: 70016
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int x,y; cin>>x>>y;
    vector<int> a(300),b(300);
    a[1] = b[1] = 300000;
    a[2] = b[2] = 200000;
    a[3] = b[3] = 100000;
    
    if (x==1 && y==1) {
        cout << a[x]+b[y]+400000 << endl;
    }
    else {
        cout << a[x]+b[y] << endl;
    }

    return 0;
}

Measured memory_bytes: 256
g = [[-1 for _ in range(15)] for _ in range(15)]
 
n = int(input())
for i in range(n):
  m = int(input())
  for j in range(m):
    x,y = map(int, input().split())
    g[i][x-1] = y

ans = 0
for i in range(1<<n):
  honests = [0 for _ in range(n)]
  for j in range(n):
    if (i>>j) &1:
      honests[j] = 1 
  ok = True
  for j in range(n):
    if honests[j]:
      for k in range(n):
        if g[j][k] == -1: continue
        if g[j][k] != honests[k]: ok = False
  if ok:
    ans = max(ans, honests.count(1))

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <vector>
#include <queue>
#include <set>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const ll MOD = (ll) (1e9 + 7);
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

void finish() {
    cout << -1 << endl;
    exit(0);
}

//------------------------------------------------------

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<int> E[100010];

    rep(i, m) {
        int u, v;
        cin >> u >> v;
        E[u].push_back(v);
    }

    int s, t;
    cin >> s >> t;

    int d[100010][3];
    rep(i, 100010) rep(j, 3) d[i][j] = -1;
    d[s][0] = 0;

    struct que_type {
        int num;
        int mod;
        int cnt;
    };
    queue<que_type> que;
    que.push({s, 0, 0});
    while (!que.empty()) {
        int from = que.front().num;
        int m = que.front().mod;
        int c = que.front().cnt;
        que.pop();
        int next_m = (m + 1) % 3;
        for (auto to : E[from]) {
            if (d[to][next_m] == -1) {
                d[to][next_m] = c + 1;
                que.push({to, next_m, c + 1});
            }
        }
    }

    cout << (d[t][0] == -1 ? -1 : d[t][0] / 3) << endl;
    return 0;
}



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

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

void solve() {
    ll a, b, c;
    cin >> a >> b >> c;
    cout << a * b / 2 << endl;   
}

int main() {
    #ifdef LOCAL_ENV
    cin.exceptions(ios::failbit);
    #endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    
    solve();

    #ifdef LOCAL_ENV
    assert(cin.rdstate() & ios_base::eofbit);
    #endif
}

Measured memory_bytes: 764
#include<stdio.h>

int main(void)
{
  int d = 0;
  scanf("%d",&d);
  
  switch(d)
  {
    case 22:
      printf("Christmas Eve Eve Eve");
      break;
    case 23:
      printf("Christmas Eve Eve");
      break;
    case 24:
      printf("Christmas Eve");
      break;
    case 25:
      printf("Christmas");
      break;
    default:
      break;
  }
  return 0;
}

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

int main(){
	
	int a,b,c,k,k1=0; cin >> a >> b >> c >> k;
	
	while (a >= b){
		b = b*2;
		k1++;
	}
	
	while (b >= c){
		c = c*2;
		k1++;
	}
	
	if (k1 <= k) cout << "Yes\n";
	else cout << "No\n";
	
	return 0;
}

Measured memory_bytes: 3584
#include <iostream>
using namespace std;
 
void print_number(int a[], int N){
     
    if(N==1){
        cout << a[0] <<endl;
        return;
    }
     
    for(int i=0; i<N-1; i++){
        cout << a[i] << " ";
    }
    cout << a[N-1] << endl;
}
 
 
int main() {
    int N, count=0;
    const int MAX_N = 100;
    int a[MAX_N];
     
    cin >> N;
    for(int i=0; i<N; i++){
        cin >> a[i];
    }
     
    int tmp, mini;
    for(int i=0; i<N; i++){
        mini = i;
        for(int j=i; j<N; j++){
            if(a[mini] > a[j]){
                mini = j;
            }
        }
        if(mini != i){
            tmp = a[mini];
            a[mini] = a[i];
            a[i] = tmp;
            count++;
        }
    }
     
     
    print_number(a, N);
    cout << count << endl;
}

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

int main() {
	int h, w, x, y;
	scanf("%d %d %d %d", &h, &w, &x, &y);
	double area = (double)h * (double)w / 2.0;
	if(x + x == h && y + y == w) {
		printf("%lf %d\n", area, 1);
	}else {
		printf("%lf %d\n", area, 0);
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<fstream>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;

int n;
int a,b;
void init()
{
 cin>>a>>b;
 if ((a*b%2) || (a*b*3)%2) cout<<"Yes"<<endl;else cout<<"No"<<endl;
}

void work()
{

}


int main()
{
    init();
    work();
    return 0;
}



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

using namespace std;

#define rep(i, n) for(auto i = 0*(n); i < (n); ++i)

int main(){
  int N, L;
  cin >> N >> L;
  vector<string> data(N);
  rep(i, N) {
    cin >> data[i];
  }

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

  rep(i, N){
    cout << data[i];
  }
  cout << endl;
  return 0;
}

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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );
		String[] list = str.split(" ");
		int w = Integer.parseInt(list[0]);
		int h = Integer.parseInt(list[1]);
		int n = Integer.parseInt(list[2]);

		String[][] xya = new String[n][];

		for(int i=0; i<n; i++){
			String string = input.readLine();
			xya[i] = string.split(" ");
		}

		int xmin = 0;
		int xmax = w;
		int ymin = 0;
		int ymax = h;

		for(int i=0; i<n; i++){
			if(xya[i][2].equals("1")){
				if(Integer.parseInt(xya[i][0]) > xmin){
					xmin = Integer.parseInt(xya[i][0]);
				}
			}else if(xya[i][2].equals("2")){
				if(Integer.parseInt(xya[i][0]) < xmax){
					xmax = Integer.parseInt(xya[i][0]);
				}
			}else if(xya[i][2].equals("3")){
				if(Integer.parseInt(xya[i][1]) > ymin){
					ymin = Integer.parseInt(xya[i][1]);
				}
			}else if(xya[i][2].equals("4")){
				if(Integer.parseInt(xya[i][1]) < ymax){
					ymax = Integer.parseInt(xya[i][1]);
				}
			}
		}

		if(xmin > xmax || ymin > ymax){
			System.out.println("0");
		}else{
			int answer = (xmax-xmin) * (ymax-ymin);
			System.out.println(answer);
		}


	}

}


Measured memory_bytes: 23252
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
string s; int a[100009], dp[100009][2];
int main() {
	ios::sync_with_stdio(false);
	while (cin >> s, s != "#") {
		int n = s.size();
		for (int i = 0; i < n; i++) a[i] = (s[i] - 48 - 1) % 3;
		for (int i = 1; i < n; i++) {
			if (a[i - 1] > a[i]) dp[i][0] = dp[i - 1][0] + 1;
			else dp[i][0] = dp[i - 1][1];
			if (a[i - 1] < a[i]) dp[i][1] = dp[i - 1][1] + 1;
			else dp[i][1] = dp[i - 1][0];
		}
		cout << min(dp[n - 1][0], dp[n - 1][1]) << endl;
	}
}

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

typedef long long int ll;
#define loop(i,s,e) for(ll i=s;i<e;i++)
#define test ll x;cin>>x;while(x--)
#define pb push_back
#define vec vector<ll>
#define sortvec(x) sort(x.begin(),x.end())
#define sz(x) x.size()

int main () {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll n,k;
	cin>>n>>k;
	ll a[n];
	loop(i,0,n)
	cin>>a[i];

	sort(a,a+n);
	ll sum=0;
	ll i=0;
	while(k--)
	{
		sum+=a[i];
		i++;
	}
	cout<<sum<<"\n";
}


Measured memory_bytes: 3648
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int[][][] Adai = new int[4][3][10];
		
		for(int i = 0; i < n; i++){
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			int v = sc.nextInt();
			Adai[b][f][r] += v;
		}
		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					System.out.print(" "+Adai[i][j][k]);
				}
				System.out.println();
			}
			if(i<3)
				System.out.println("####################");
		}
	}
}


Measured memory_bytes: 29188
import Control.Applicative
import Data.Bool (bool)
import Data.Char (isDigit, isLower, isUpper)

main :: IO ()
main = solve <$> getLine >>= putStrLn

solve :: String -> String
solve pw = bool "INVALID" "VALID" $ length pw >= 6 &&
           any isDigit pw &&
           any isUpper pw &&
           any isLower pw



Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define FOR(a,x) for(int i=a; i<x; i++)

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int h,w;
    cin>>h>>w;
    FOR(0,w+2) cout<<"#";
    cout<<"\n";
    char c;
    FOR(0,h) {
        cout<<"#";
        FOR(0, w) {
            cin>>c;
            cout<<c;
        }
        cout<<"#\n";
    }
    FOR(0,w+2) cout<<"#";
}

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

using namespace std;

complex<int> scan() {
  int x, y;
  cin >> x >> y;
  return complex<int>(x, y);
}

int main() {
  auto a = scan();
  auto b = scan();
  auto c = b + (b - a) * complex<int>(0, 1);
  auto d = c + (c - b) * complex<int>(0, 1);
  printf("%d %d %d %d\n", c.real(), c.imag(), d.real(), d.imag());
}


Measured memory_bytes: 256
/**
 *	   author: nayakashutosh9 
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
#define mod 1000000007
#define inf 1e18
 
/*******************************************************************/
 

int n,m;
unordered_map<int,vector<int>> g;
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
 //    int t,tc=1;cin>>t;
	// cin.ignore();
	// while(t--){

	// }
	cin>>n>>m;
	g.clear();
	for(int i=0;i<m;i++){
		int x,y;cin>>x>>y;
		g[x].push_back(y);
		g[y].push_back(x);
	}
	vector<int> parent(n+1,-1);
	vector<bool> vis(n+1,0);
	parent[1]=0;
	queue<int> q;q.push(1);
	vis[1]=1;
	while(!q.empty()){
		int f=q.front();q.pop();
		for(int x:g[f]){
			if(!vis[x]){
				parent[x]=f;
				q.push(x);
				vis[x]=1;
			}
		}
	}
	bool ans=true;
	for(int i=2;i<=n;i++){
		if(parent[i]==-1){
			ans=false;break;
		}
	}
	if(!ans) cout<<"No\n";
	else{
		cout<<"Yes\n";
		for(int i=2;i<=n;i++) cout<<parent[i]<<endl;
	}
}

Measured memory_bytes: 17100
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
	char s[4];
	char abc[] = "ABC";
	char arc[] = "ARC";

	scanf("%s", &s);

	if (strcmp(s, abc) == 0)
	{
		printf("%s\n",arc);
	}
	else
	{
		printf("%s\n", abc);
	}

	return 0;
}

Measured memory_bytes: 1664
#include <iostream>

using namespace std;

int main(){
  int a,b;
  int r1,r2,r3;
  scanf("%d%d",&a,&b);
  r1=a+b;
  r2=a-b;
  r3=a*b;
  if(r1<r2)r1=r2;
  if(r1<r3)r1=r3;
  cout<<r1<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define sz(v) (v).size()
#define debug(x) cerr << #x << "_=_" << x << "\n";
#define sum(n) ((n)*((n)+1)>>1)
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<pair<int, int>, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;

const int MAXN = 1e5+5;
int dp[MAXN];
vvi graph;
vi vis, top;

void dfs(int u){
    vis[u]=1;
    for (int v : graph[u])
        if(!vis[v])
            dfs(v);
    top.pb(u);
}

int path(int u){
    if(~dp[u]) return dp[u];
    int best=0;
    for (int v : graph[u]){
        best = max(best, path(v) + 1);
    }
    return dp[u] = best;
}

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


    int n, m;
    cin >> n >> m;
    graph.assign(n+1, vi());
    vis.assign(n+1, 0);

    for (int i=0; i<m; i++){
        int u, v;
        cin >> u >> v;
        graph[u].pb(v);
    }

    for (int i=1; i<=n; i++){
        if(!vis[i])
            dfs(i);
    }

    reverse(all(top));
    memset(dp, -1, sizeof dp);

    int ans=0;
    for (int i : top){
        ans = max(ans, path(i));
    }

    cout << ans << "\n";




    return 0;
}

/*
1
9 3
111100000
 */

Measured memory_bytes: 11768
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using static System.Math;
using static System.Console;
using static System.Linq.Enumerable;
using static System.Numerics.BitOperations;

namespace ABC175
{
    class SolverA
    {
        static void Main()
        {
            SetOut(new StreamWriter(Console.OpenStandardOutput()){AutoFlush = false});
            new SolverA().Solve();
            Out.Flush();
        }

        public void Solve()
        {
            var s = Get.Str();
            if(s.Contains("RRR")){
                WriteLine(3);
            }else if(s.Contains("RR")){
                WriteLine(2);
            }else if(s.Contains("R")){
                WriteLine(1);
            }else{
                WriteLine(0);
            }
        }




        static class Get
        {
            public static string Str() => ReadLine().Trim();
            public static int Int() => int.Parse(Str());
            public static long Long() => long.Parse(Str());
            public static double Double() => double.Parse(Str());
            public static string[] Strs() => Str().Split(' ', StringSplitOptions.RemoveEmptyEntries);
            public static int[] Ints() => Strs().Select(int.Parse).ToArray();
            public static long[] Longs() => Strs().Select(long.Parse).ToArray();
            public static double[] Doubles() => Strs().Select(double.Parse).ToArray();
            static bool TypeEq<T,U>() => typeof(T).Equals(typeof(U));
            static T TypeConv<T,U>(U u) => (T)Convert.ChangeType(u, typeof(T));
            static T TypeConv<T>(string s) => TypeEq<T, int>() ?   TypeConv<T, int>(int.Parse(s))
                                        : TypeEq<T, long>() ?       TypeConv<T, long>(long.Parse(s))
                                        : TypeEq<T, double>() ?     TypeConv<T, double>(long.Parse(s))
                                        : TypeConv<T, string>(s);
            public static (T,U) Tuple<T,U>() {string[] strs = Strs(); T t = TypeConv<T>(strs[0]); U u = TypeConv<U>(strs[1]); return(t,u);}
            public static (T,U,V) Tuple<T,U,V>() {string[] strs = Strs(); T t = TypeConv<T>(strs[0]); U u = TypeConv<U>(strs[1]); V v = TypeConv<V>(strs[2]); return(t,u,v);}
        }
    }

    
}


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

int main() {
  long long A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  
  if (A + B >= 2 * C){
    if (X >= Y) cout << min(2 * Y * C + A * (X - Y), 2 * X * C) << endl;
    else cout << min(2 * X * C + B * (Y - X), 2 * Y * C) << endl;
  }
  else {
    cout << A * X + B * Y << endl;
  }
}

Measured memory_bytes: 3600
N, M = map(int, input().split())
l = 1
r = N
for i in range(M):
  L, R = map(int, input().split())
  if L > l:
    l = L
  if r > R:
    r = R
if l > r:
  print(0)
else:
  print(r-l+1)

Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
int main(){
    string str;
    int cnt=0;
    cin>>str;
    int l=str.length();
    map<char,int>M;
    M['(']=100;M[')']=200;
    for(int i=0;i<(l+1)/2;i++){
        if(M[str[i]]+M[str[l-i-1]]==200||M[str[i]]+M[str[l-i-1]]==400)cnt++;
        else if(M[str[i]]+M[str[l-i-1]]==300);
        else if(str[i]!=str[l-i-1])cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}
//M[str[i]]+M[str[l-i-1]]==300

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

int main() {
  int K;
  string S;
  int size;
  cin >> K >> S;
  
  size = S.size();
  
  if(K >= size){
    cout << S << endl;
  }
  else{
    cout << S.erase(K) << "..." << endl;
  }
}


Measured memory_bytes: 3624
N=int(input())
H=list(map(int,input().split()))
if N==1:
    print('Yes')
else:
    for i in range(N-1,0,-1):
        if H[i-1]-H[i]==1:
            H[i-1]=H[i-1]-1
        elif H[i-1]-H[i]>=2:
            print('No')
            break
        elif i==1 and H[1]-H[0]>=0:
            print('Yes')


Measured memory_bytes: 63984
#include <bits/stdc++.h>
#define rep0(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define mREP(i,a,b) for (int i = a; i > (b); --i)
#define all(x) (x).begin(),(x).end()
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int ans = 0;
int solve (){
  int n;
  cin >> n;
  vector<int>L(n);
  rep0(i,n)cin >> L[i];
  sort(L.begin(),L.end());
  rep0(b,n){
    rep0(a,b){
      int ab = L[a] + L[b];
      int temp = lower_bound(L.begin(),L.end(),ab) - L.begin();
      int temp2 = b + 1;
      ans += max(temp - temp2,0);
    }
  }
  return ans;
}
int main(){
  solve();
  cout << ans<< endl;
  return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <functional>
#include <iomanip>
#include <bitset>
#include <numeric>
#include <queue>
#include <map>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
const long long mod = 1000000007;
typedef long long ll;
typedef pair<int, double> P;
const vector<int> di = {-1, 0, 1, 0};
const vector<int> dj = { 0, 1, 0, -1 };

int main() {
	
	string s, t, u;
	cin >> s >> t;
	int a, b;
	cin >> a >> b;
	cin >> u;

	if (u == s) a--;
	if (u == t) b--;

	cout << a << ' ' << b << endl;

	return 0;
}

Measured memory_bytes: 256
S=input()
even=len(S)//2
odd=len(S)-even
odd0=0
even0=0
for i,s in enumerate(S):
  if s=="0":
    if (i+1)%2==0:
      even0 += 1
    else:
      odd0  += 1
even1=even-even0
odd1=odd-odd0
print(min(odd1+even0,odd0+even1) )

Measured memory_bytes: 39536
#include<stdio.h>
int main(void){
  int a,b,k,tmp,i,j,num[100],cnt=0,l=0;
  scanf("%d %d %d",&a,&b,&k);
  if(a>b){
    tmp=a;
    a=b;
    b=tmp;
  }
  for(i=a;i>0;i--){
    if(a%i==0){
      num[cnt]=i;
      cnt++;
    }
  }
  for(i=0;i<cnt;i++){
    if(b%num[i]==0){
      l++;
    }
    if(l==k){
      break;
    }
  }
  printf("%d",num[i]);
  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
const int M = 1000000007;

int main() {
    while (1) {
        int m, n;
        cin >> m >> n;
        if (!m) return 0;

        int lim = 7400000;
        bitset<7400000> isok;
        for (int i = m; i < lim; ++i) {
            if (isok[i]) continue;
            if (!n) {
                cout << i << "\n";
                break;
            }
            --n;
            if (m == 2) {
                isok.set(i);
                if (i < 3000)
                    for (int j = i * i; j < lim; j += i)
                        isok.set(j);

                continue;
            }
            for (int j = i; j < lim; j += i)
                isok.set(j);
        }
    }
}

Measured memory_bytes: 4004
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();
        int n3 = sc.nextInt();
        int total = n1 + n2 + n3;

        if (total >= 22)
            System.out.println("bust");
        else
            System.out.println("win");
    }
}


Measured memory_bytes: 35404
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
inline int read(){
	int ret=0,p=1;
	char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') p=-1;
	for (;isdigit(ch);ch=getchar()) ret=ret*10+ch-'0';
	return ret*p;
}
int n;
vector <int> a[100000+3];
struct str{
	int fa,son,bro;
	int size;
}s[100000+3];
inline void add(int x,int fa){
	s[x].fa=fa;
	s[x].bro=s[fa].son;
	s[fa].son=x;
}
void dfs(int x,int fa){
	add(x,fa);
	for (int i=0;i<a[x].size();i++){
		if (a[x][i]!=fa){
			dfs(a[x][i],x);
			s[x].size+=s[a[x][i]].size;
		}
	}
	s[x].size++;
}
int f[100000+3],t;
int main(){
	n=read();
	for (int i=1;i<n;i++){
		int x=read(),y=read();
		a[x].push_back(y);a[y].push_back(x);
	}
	dfs(1,0);
	int now=n;
	while (now!=1){
		f[++t]=now;
		now=s[now].fa;
	}
	f[++t]=1;
	if (s[1].size>s[f[t/2]].size*2){
		puts("Fennec");
	}else{
		puts("Snuke");
	}
	return 0;
}

Measured memory_bytes: 15488
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <utility>
#define EPS 1e-10
using namespace std;
typedef long long ll;
struct Point{
	double x,y;
	Point(double x = 0.0,double y = 0.0): x(x),y(y) {}
	Point operator + (Point p){
		return Point(x + p.x,y + p.y);
	}
	Point operator - (Point p){
		return Point(x - p.x,y - p.y);
	}
	Point operator * (double lambda){
		return Point(x * lambda,y * lambda);
	}
	Point operator / (double lambda){
		return Point(x / lambda,y / lambda);
	}
	double norm(){
		return x * x + y * y;
	}
	double abs_(){
		return sqrt(norm());
	}
	bool operator == (const Point &p)const
	{
		return abs(x - p.x) < EPS && abs(y - p.y) < EPS;
	}
	bool operator < (const Point &p)const
	{
		if(abs(x - p.x) < EPS) return y - p.y < -EPS;
		else return x - p.x < EPS;
	}
};
typedef Point Vector;
struct Segment{
	Point p1,p2;
	Segment(Point p1 = Point(),Point p2 = Point()): p1(p1),p2(p2) {}
};
typedef Segment Line;
struct Circle{
	Point c;
	double r;
	Circle(Point c = Point(),double r = 0.0): c(c),r(r) {}
};
typedef vector<Point> Polygon;
double dot(Vector a,Vector b){
	return a.x * b.x + a.y * b.y;
}
double det(Vector a,Vector b){
	return a.x * b.y - b.x * a.y;
}
bool vertical(Line l1,Line l2){
	return abs(dot(l1.p2 - l1.p1,l2.p2 - l2.p1)) < EPS;
}
bool parallel(Line l1,Line l2){
	return abs(det(l1.p2 - l1.p1,l2.p2 - l2.p1)) < EPS;
}
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		Line l1,l2;
		scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&l1.p1.x,&l1.p1.y,&l1.p2.x,&l1.p2.y,&l2.p1.x,&l2.p1.y,&l2.p2.x,&l2.p2.y);
		if(parallel(l1,l2)) puts("2");
		else if(vertical(l1,l2)) puts("1");
		else puts("0");
	}
	return 0;
}



Measured memory_bytes: 3252
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define sz(x) ((int)(x).size())
typedef long long ll;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VP = vector<P>;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

const int inf = 1 << 30;
const ll INF = 1LL << 60;

int main(){
    int x;
    cin >> x;
    VI m = {100, 101, 102, 103, 104, 105};
    vector<vector<bool>> dp(7, vector<bool>(x+1, false));
    dp[0][0] = true;
    rep(i, sz(m)){
        int mon = m[i];
        rep(xi, x+1){
            dp[i+1][xi] = dp[i+1][xi] | dp[i][xi];
            if (xi - mon >= 0){
                dp[i+1][xi] = dp[i+1][xi] | dp[i+1][xi-mon];
            } 
        }
    }
    if (dp[sz(m)][x]) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}

Measured memory_bytes: 3648
from sys import stdin, stdout
# from math import sqrt, pi, acos, gcd, atan2, cos, sin, factorial, log10
# # from matplotlib import mlab
# # from matplotlib import pylab
# # from decimal import Decimal
# # from random import randint
# # import re
# PEPS = 1e-10
# INF = float('inf')
#
#
# def sqr(a):
#     return a * a
#
#
# def dist(a, b = (0, 0)):
#     return sqrt(sqr(a[0] - b[0]) + sqr(a[1] - b[1]))
#
#
# def s_dist(a, b = (0, 0)):
#     return (sqr(a[0] - b[0]) + sqr(a[1] - b[1]))
#
#
# def dist3(a, b = (0, 0, 0)):
#     return sqrt(sqr(a[0] - b[0]) + sqr(a[1] - b[1]) + sqr(a[2] - b[2]))
#
#
# def s_dist3(a, b = (0, 0, 0)):
#     return (sqr(a[0] - b[0]) + sqr(a[1] - b[1]) + sqr(a[2] - b[2]))
#
#
# def trans(p, al):
#     return (p[0] * cos(al) + p[1] * sin(al), - p[0] * sin(al) + p[1] * cos(al))
#
#
# def get_angle(a, b, c):
#     cos_al = (sqr(a) + sqr(b) - sqr(c)) / (2 * a * b)
#     return acos(cos_al)
#
#
# def write_float(ans):
#     stdout.write(str('%.13f' % ans) + '\n')
#
#
# def get_hight(pt1, pt2, pt3):
#     a = (pt2[0] - pt1[0], pt2[1] - pt1[1])
#     b = (pt3[0] - pt1[0], pt3[1] - pt1[1])
#     return abs(a[0] * b[1] - a[1] * b[0]) / dist(pt1, pt2)
#
#
# def get_square(pt1, pt2, pt3):
#     a = (pt2[0] - pt1[0], pt2[1] - pt1[1])
#     b = (pt3[0] - pt2[0], pt3[1] - pt2[1])
#     return (a[0] * b[-1] - a[1] * b[0]) / 2
#
#
# def sign(v):
#     if v > 0:
#         return 1
#     elif v < 0:
#         return -1
#     else:
#         return 0
#
#
# def inn(pt, triangle):
#     signs = set()
#     signs.add(sign(get_square(triangle[0], triangle[1], pt)))
#     signs.add(sign(get_square(triangle[1], triangle[2], pt)))
#     signs.add(sign(get_square(triangle[2], triangle[0], pt)))
#     return len(signs) == 1
#
#
# def inter_in(a, b):
#     return dist((a[0], a[1]), (b[0], b[1])) < a[-1] + b[-1]
#
#
# def inter_in3(a, b):
#     return dist3(a[:-1], b[:-1]) < a[-1] + b[-1]
#
#
# def shift(what, wth):
#     return (what[0] - wth[0], what[1] - wth[1])
#

n = int(stdin.readline())
s = stdin.readline().strip()
stdout.write(['No', 'Yes'][s.count('R') > s.count('B')])

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

using namespace std;

typedef long long ll;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll a, b, c;
    cin >> a >> b >> c;
    ll ans = a * b * (c % 2);
    ans = min(ans, a * c * (b % 2));
    ans = min(ans, b * c * (a % 2));
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<ll(n); i++)
#define REPR(i, n) for(ll i=n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=m; i<ll(n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(x) ll(x.size()) 
using P = pair<int, int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 2e9;
const ll LINF = (1LL<<60);

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,m; cin >> n >> m;
  priority_queue<int> que;
  REP(i,n){
    int a; cin >> a;
    que.push(a);
  }

  REP(j,m){
    int tp = que.top();
    que.pop();
    que.push(tp/2);
  }

  ll ans = 0;
  while(!que.empty()){
    ans += que.top();
    que.pop();
  }
  cout << ans << endl;
  return 0;
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll a, b; cin >> a >> b;
    if (a > b){rep(i, a){cout << b;}}
    else if (a < b){rep(i, b){cout << a;}}
    else {rep(i, a){cout << a;}}
}


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


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

using namespace std;

using ll = long long;
using ld = long double;

const double PI = 3.1415926535897932384626433832795;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : abs(x); }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

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

	int n;
	cin >> n;

	vector<int> w(n);
	for (auto &v : w) {
		cin >> v;
	}

	int ans = INT_MAX;
	for (int t = 0; t < n - 1; t++) {
		int s1 = 0;
		for (int i = 0; i <= t; i++) {
			s1 += w[i];
		}

		int s2 = 0;
		for (int i = t + 1; i < n; i++) {
			s2 += w[i];
		}

		int score = abs(s1 - s2);
		ans = min(ans, score);
	}

	cout << ans << endl;
	return 0;
}


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

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define M_PI 3.14159265358979323846

#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

#ifdef __LOCAL
    #include <filesystem>
    namespace fs = std::filesystem;
#endif

using namespace std;
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 0};
int dy[]={0, 1, 0, -1, 0};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
 
std::string pad(int num){ char buffer[4]; std::snprintf(buffer, sizeof(buffer), "%03d", num); return buffer;}
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }



int main()
{
    fast_io();
    #ifdef __LOCAL
        fs::path p = __FILE__;
        fs::path input,output;
        input = output = p.parent_path();
        input += string("/input/") + string(p.stem()) + string(".txt");
        output += string("/output/") + string(p.stem()) + string(".txt");
        freopen(input.c_str(), "r", stdin);
        freopen(output.c_str(), "w", stdout);
    #endif
    int H,A;    
    cin >> H >> A;
    cout << H/A + (H%A!=0) << endl;

    return 0;


}


Measured memory_bytes: 256
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var str=input.trim();
var arr=[0];
if(/J/.test(str)==false)str="";
if(/O/.test(str)==false)str="";
if(/I/.test(str)==false)str="";
str.replace(/(J+)(O+)(I+)/g,function(s,s1,s2,s3){
   if(s1.length>=s2.length && s3.length>=s2.length)arr.push(s2.length);
   return "";
});
console.log(Math.max.apply(null,arr));

Measured memory_bytes: 37340
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, n)       for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, s, t)   for (i64 i = (s), i##_limit = (t); i <= i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#ifndef DBG
#define trace(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> make_v(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto make_v(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initValue, args...))>(sz, make_v<T>(initValue, args...));
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail&... tail) { cin >> head; read(tail...); }

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<< (ostream &out, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) out << e << delim[&e == &vec.back()];
    return out;
}
// }}} End Header

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr);

    string s;
    cin >> s;

    int const N = s.length();

    int ans = N;
    rep(i, N-1) {
        if (s[i] != s[i+1]) chmin(ans, max(i+1, N-(i+1)));
    }

    print(ans);

    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <algorithm>
#include <map>
#include <cstdlib>
#include <cmath>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

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

int main(){
    int a,b;
    cin >> a >> b;
    cout << lcm(a,b) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<int,int> ii;
 
int main() {
    int a, b;
    cin >> a >> b;
    int cur = 1;
    int rez = 0;
    while (cur < b) {
        ++rez;
        cur += (a - 1);
    }
    cout << rez << "\n";
    return 0;
}

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n, k, a[101];
int d[101];
void solve(){
	cin >> n >> k;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		d[i+1] = d[i]+a[i];
	}
	sort(a,a+n,greater<int>());
	
	int ma = 0;
	for(int i = 0; i < k; i++){
		ma += a[i];
	}
	cout << ma << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
using namespace std;
const int hi = int(1e9) - 1;
const int lo = 0 - int(1e9);

int W, H, w, h, a[510][510];

int main(){
	scanf("%d %d %d %d", &H, &W, &h, &w);
	if ( H % h == 0 && W % w == 0 ) {
		printf("No\n");
		return 0;
	}
	for ( int i = 0; i < H; i += h )
		for ( int j = 0; j < W; j += w )
			a[i][j] = hi;
	for ( int i = h - 1; i < H; i += h )
		for ( int j = w - 1; j < W; j += w )
			a[i][j] = lo;
	printf("Yes\n");
	for ( int i = 0; i < H; i++ ){
		for ( int j = 0; j < W; j++ )
			printf("%d ", a[i][j]);
		printf("\n");
	}
	
	return 0;
}

Measured memory_bytes: 3840
#include <iostream>

using namespace std;

bool judge(int x){
  if(x > 0 && x <= 12) return true;
  else return false;
}

int main(){
  int S;
  cin >> S;
  int first = S/100;
  int last = S%100;
  if(judge(last)){
    if(judge(first)) cout << "AMBIGUOUS" << "\n";
    else cout << "YYMM" << "\n";
  }else{
    if(judge(first)) cout << "MMYY" << "\n";
    else cout << "NA" << "\n";
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF=999999999;
int main() {
 int64_t N,K;
 cin>>N>>K;
 int64_t ans=1;
 for(int i=0;i<N-1;i++){
     ans*=(K-1);
 }
 cout<<K*ans<<endl;
 return 0;}

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

int main()
{
    int n;
    cin>>n;
    if(n>=400&&n<600)
     cout<<8;
    else if(n>=600&&n<800)
     cout<<7;
     else if(n>=800&&n<1000)
     cout<<6;
      else if(n>=1000&&n<1200)
     cout<<5;
      else if(n>=1200&&n<1400)
     cout<<4;
      else if(n>=1400&&n<1600)
     cout<<3;
      else if(n>=1600&&n<1800)
     cout<<2;
      else if(n>=1800&&n<2000)
     cout<<1;

    return 0;
}


Measured memory_bytes: 3636
#include <iostream>

using namespace std;

int main(){
  int D;
  cin >> D;
  if (D == 22) cout << "Christmas Eve Eve Eve";
  else if (D == 23) cout << "Christmas Eve Eve";
  else if (D == 24) cout << "Christmas Eve";
  else if (D == 25) cout << "Christmas";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(s,i, n) for (int i = (int)s; i < (int)(n); i++)
#define pb push_back
typedef long long ll;



int main(){
    string s;
    cin>>s;
    string ans="No";
    if(s[0]=='7' || s[1]=='7' || s[2]=='7')ans="Yes";
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
int a,b,i;
string s;
int main()
{
	cin>>a>>b;
	cin>>s;
	if(s[a]!='-') 
	 {
	 	cout<<"No";
	 	return 0;
	 }
	for(i=0;i<=a+b;i++)
	 {
	 	if(s[i]-'0'<0||s[i]-'0'>9)
	 	 {
	 	 	if(i!=a) 
	 	 	 {
	 	 	 	cout<<"No";
	 	 	 	return 0;
			 }
		 }
	 }
	cout<<"Yes";
	return 0;
 } 

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

int main() {
  string s,t,u;
  int a,b;
  cin >> s >> t >> a >> b >> u;
  
  if(s==u){
    a--;
  }
  else{
    b--;
  }
  cout << a << ' ' << b << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int main(void){
	int n;
	double X,Y,a;
	Y=100.0;
	n=0;
	scanf("%lf",&X);
	while(Y<X){
		n=n+1;
		a=floor(Y/100);
		Y=Y+a;
	}
	printf("%d\n",n);
	return 0;
}

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

int main(){
  ll l, r;
  cin >> l >> r;
  
  ll ans = 2019;
  for ( ll i = l; i <= min(r, l + 2018LL); i++){
    for ( ll j = i + 1; j <= min(r, i + 2019LL); j++){
      ans = min(ans, (i * j) % 2019LL);
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
while True :
	x = list(input())
	if(x[0] == "#") :
		break
	else :
		left = "qwertasdfgzxcvb"
		right = "yuiophjklnm"
		cnt = 0
		for i in range(len(x) - 1) :
			L = x[i] in left and x[i + 1] in left
			R = x[i] in right and x[i+1] in right
			if(L or R) :
				pass
			else :
				cnt += 1
		print(cnt)


Measured memory_bytes: 5564
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text.RegularExpressions;

namespace AtCoder_Core
{
    class Program
    {
        static void Main(string[] args)
        {
            string N=Console.ReadLine();
            string result = string.Empty;
            int a = int.Parse(N[N.Length-1].ToString());
            if (a == 2 || a == 4 || a == 5 || a == 7 || a == 9)
            {
                Console.WriteLine("hon");
            }
            else if(a==0||a==1||a==6||a==8)
            {
                Console.WriteLine("pon");
            }
            else
            {
                Console.WriteLine("bon");
            }

        }
    }

}

Measured memory_bytes: 27536
n,h=map(int,input().split())
a,b=[0]*n,[0]*n
for i in range(n):
    a[i],b[i]=map(int,input().split())
p=max(a)
b.sort(reverse=True)
ans=0
for i in range(n):
    if b[i]>=p:
        ans+=1
        h-=b[i]
        if h<=0:
            print(ans)
            exit()
x=(-h//p)*(-1)
ans+=x
print(ans)


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

namespace ConsoleApplication7
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var a = new List<int>();
            a.Add(0);
            var input = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            for(int i = 0; i < n;i++)
            {
                a.Add(input[i]);
            }
            a.Add(0);

            int firstPlan = 0;
            for(int i = 0; i < n + 1; i++)
            {
                firstPlan += Math.Abs(a[i] - a[i + 1]);
            }
            int dif = 0;
            for(int i = 0; i < n; i++)
            {
                dif = Math.Abs(a[i] - a[i + 1]) + Math.Abs(a[i + 1] - a[i + 2]) - Math.Abs(a[i] - a[i + 2]);
                Console.WriteLine(firstPlan - dif);
            }
        }
    }
}

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

int N;
vector<int> G[10010];
vector<int> V;
int cnt = 0, l[100010];

int DFS(int v, int p = 0)
{
    l[v] = V[cnt++];
    for(int i = 0; i < G[v].size(); i++)if(G[v][i] != p)DFS(G[v][i], v);
    return 0;
}

int main()
{
    cin >> N;
    for(int i = 0; i < N - 1; i++)
    {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for(int i = 0; i < N; i++)
    {
        int a;
        cin >> a;
        V.push_back(a);
    }

    sort(V.begin(), V.end());
    reverse(V.begin(), V.end());

    DFS(1);

    int ans = 0;
    for(int i = 1; i < V.size(); i++)ans += V[i];
    cout << ans << endl;
    for(int i = 1; i <= N; i++)
    {
        cout << l[i];
        if(i != N)cout << " ";
    }
    cout << endl;

    return 0;
}


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

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<vector<double>> dp(N+1);
    dp[0].push_back(1);
    for (int i = 0; i < N; i++) {
        double d;
        cin >> d;
        dp[i + 1] = vector<double>(i+2, 0);
        for(int j = 0; j <i+1 ; j++) {
            dp[i+1][j+1] += dp[i][j] * d;
            dp[i+1][j] += dp[i][j] * (1-d);
        }
    }
    double ans = 0;
    for (int i = 0; i <=N ; i++) {
        if (i > N-i) {
            ans += dp[N][i];
        }
    }
    printf("%.20f\n", ans);
}



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

int main(){
  int a, b, k; cin >> a >> b >> k;
  
  for(int i=0;i<k;i++){
    if(i%2==0){
      b += a / 2; a /= 2;
    }else{
      a += b / 2; b /= 2;
    }
  }
  
  cout << a << ' ' << b << endl;
  return 0;
}

Measured memory_bytes: 256
ABM = list(map(int, input().split()))
price_A = list(map(int, input().split()))
price_B = list(map(int, input().split()))

waribiki = []
for i in range(ABM[2]):
    waribiki.append(list(map(int, input().split())))

result = []
for i in waribiki:
    result.append(price_A[i[0] - 1] + price_B[i[1] - 1] - i[2])

result.append(min(price_A) + min(price_B))

print(min(result))


Measured memory_bytes: 42400
#include<iostream>
#include<cstring>
#include<map>
#include<vector>
#include<set>
#include<cstring>
#include<algorithm>
#include<cmath>
#define Max zhi5968
typedef long long ll;
using namespace std;

int main ()
{
	int a,b,i;
	cin>>a>>b;
	int v=1;
	for(i=0;i<a;i++)
		v=min(2*v,v+b);
	cout<<v<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
const int MAXN=10000;
using namespace std;

void mainp()
{
	string s;
	cin>>s;
	
	for(int i=0; i<s.size()-1; i++)
	{
		if(s[i]=='A'&&s[i+1]=='C')
		{
			cout<<"Yes"<<endl;
			return;
		}
	}
	
	cout<<"No"<<endl;
	return;
}
int main()
{
	mainp();
	return 0;
}


Measured memory_bytes: 256