akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include <cmath>
#include <limits>
#include<set>
#include <iomanip>
#include <queue>
#include <map>
#include <string>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef double ld;
const long long INF=(1LL<<62);
const double inf=pow(10,10);
double pi=3.141592653589793;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
const ll MOD = 1000000007;
void init(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
}

struct UnionFind {
  vector< int > data;
 
  UnionFind(int sz) {
    data.assign(sz, -1);
  }
 
  bool unite(int x, int y) {
    x = find(x), y = find(y);
    if(x == y) return (false);
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y];
    data[y] = x;
    return (true);
  }
 
  int find(int k) {
    if(data[k] < 0) return (k);
    return (data[k] = find(data[k]));
  }
 
  int size(int k) {
    return (-data[find(k)]);
  }
};


int main(){
	init();
	ll A,B;cin>>A>>B;
	if(A>=13)cout<<B<<endl;
	else if(A<=5)cout<<0<<endl;
	else cout<<B/2<<endl;
}


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

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define RFOR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX

const double EPS = 1e-14;
const double PI  = acos(-1.0);


char cs[4] = {'3', '5', '7'};
vector<string> v;

void make(int x, string s) {
  if (s.size() > 0) v.push_back(s);
  if (x == 0) {
    return;
  }
  REP (i, 3) {
    make(x - 1, s + cs[i]);
  }
}

bool check(string s) {
  bool has[3] = {false};
  REP (i, 3) {
    if (s.find(cs[i]) != string::npos) {
      has[i] = true;
    }
  }
  return has[0] && has[1] && has[2];
}

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

  make(9, "");

  int ans = 0;
  for (auto t : v) {
    if (check(t) && stoi(t) <= n) ans++;
  }

  cout << ans << endl;
}


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

struct Roadwork {
  Roadwork(int s, int t, int x):
      s_(s), t_(t), x_(x) {}

  int s_, t_, x_;
};

int argfloor_binsearch(
    const std::vector<int> &sorted_vec,
    int v)
{
  size_t len = sorted_vec.size();
  if(v < sorted_vec[0]) {
    return -1;
  }
  if(*sorted_vec.rbegin() < v) {
    return len;
  }

  size_t min = 0, max = len-1;
  size_t n = min + (max-min)/2;

  while(min <= max) {
    n = min + (max-min)/2;

    if(sorted_vec[n] <= v && v < sorted_vec[n+1]) {
      break;
    } else if(v < sorted_vec[n]) {
      max = n - 1;
    } else {
      min = n + 1;
    }
  }

  return n;
}

/**
 * search [from, to) values from sorted_vec.
 *
 * \return if true, argfrom and argto are set.
 */
bool argbetween(
    const std::vector<int> &sorted_vec,
    int from, int to,
    int &argfrom, int &argto)
{
  if(to <= from) return false;

  // binary search
  argfrom = argfloor_binsearch(sorted_vec, from);
  argto = argfloor_binsearch(sorted_vec, to);

  return true;
}

int main()
{
  int N, Q;
  std::cin >> N >> Q;
  std::vector<Roadwork> rws;
  std::vector<int> D(Q);
  std::vector<int> skip(Q, -1);
  std::vector<int> ret(Q, -1);

  for(int i=0; i<N; i++) {
    int s, t, x;
    std::cin >> s >> t >> x;
    rws.push_back(Roadwork(s, t, x));
  }
  std::sort(rws.begin(), rws.end(),
            [](Roadwork &lhs, Roadwork &rhs) -> bool
            {
              return lhs.x_ < rhs.x_;
            });
  // std::cout << "rws" << std::endl;
  // std::for_each(rws.cbegin(), rws.cend(),
  //               [](auto &x) { std::cout << x.x_ << " s " << x.s_ << ", "; });
  // std::cout << std::endl;


  for(int i=0; i<Q; i++) {
    std::cin >> D[i];  // already sorted by ascending order
  }

  int argfrom, argto;
  for(auto &rw: rws) {
    int s = rw.s_;
    int t = rw.t_;
    int x = rw.x_;

    if(argbetween(D, s-x, t-x, argfrom, argto)) {
      // std::cout << "before argfrom: " << argfrom
      //           << " argto: " << argto
      //           << " x: " << x
      //           << " s-x: " << s-x
      //           << " t-x: " << t-x
      //           << std::endl;

      if(argto < 0) continue;
      if(argfrom == (int)D.size()) continue;

      if(argfrom < 0 || D[argfrom] < s-x) {
        argfrom++;
      }

      if(argto == (int)D.size() || (argto < (int)D.size() && D[argto] == t-x)) {
        argto--;
      }

      // std::cout << "after argfrom: " << argfrom
      //           << " argto: " << argto
      //           << std::endl;

      int i;
      for(i=argfrom; i<=argto;) {
        // avoid linear search
        if(skip[i] >= 0) {
          i = skip[i];
          continue;
        }
        if(ret[i] < 0) {
          ret[i] = x;
          skip[i] = argto + 1;
        }
        i++;
      }
    }
  }

  for(auto r: ret) {
    std::cout << r << std::endl;
  }

  return 0;
}


Measured memory_bytes: 8692
#include <algorithm>
#include <bitset>
// #include <boost/algorithm/string/replace.hpp>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>

using namespace std;

#define FOR(i, j, n) for (int i = j; i < n; i++)
#define OUT(s) cout << s << " ";
#define IN(a) cin >> a;
#define PACK(a, n)                                                             \
  for (int i = 0; i < n; i++)                                                  \
    cin >> a[i];
#define LIST(a, n)                                                             \
  for (int i = 0; i < n; i++)                                                  \
    cout << i << ": " << a[i] << endl;
#define PP(label, obj) cout << "[" << label << "] " << obj << endl;

int main() {
  string S;
  IN(S);

  int len = S.length();
  int even = 0;
  int odd = 0;
  int rpos = -1;
  FOR(i, 0, len) {
    if (i % 2 == 0) {
      even += 1;
    } else {
      odd += 1;
    }
    if ((i + 1 == len || S[i + 1] == 'R') && S[i] == 'L') {
      if (rpos % 2 == 0) {
        OUT(even);
        OUT(odd);
      } else {
        OUT(odd);
        OUT(even);
      }
      FOR(j, 0, i - rpos - 1) {
        OUT(0);
      }
      rpos = -1;
      even = 0;
      odd = 0;
    } else if (S[i + 1] == 'L' && S[i] == 'R') {
      rpos = i;
    } else {
      if (rpos == -1) {
        OUT(0);
      }
    }
  }
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
  string s; cin >> s;
  int x = s.size();
  if(x<=n) cout<<s;
  else{
      for(int i = 0; i < n; i++)
        cout<<s[i];
        
    cout<<"...";
  }
  
  return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

i64 n;
vector<string> s;

vector<int> col;
bool dfs(int u, int c) {
  if (col[u] == c) return true;
  if (col[u] != 0 && col[u] != c) return false;
  col[u] = c;
  bool ok = true;
  for (int v = 0; v < n; ++v) {
    if (s[u][v] == '1') {
      ok = dfs(v, -c) && ok;
    }
  }
  return ok;
}

int main() {
  cin >> n;
  read_n(s, n);

  col.resize(n);
  bool ok = dfs(0, 1);
  if (!ok) {
    cout << -1 << endl;
    return 0;
  }

  i64 ans = 0;
  for (int x = 0; x < n; ++x) {
    vector<i64> dist(n);
    dist[x] = 1;
    queue<int> que;
    que.push(x);
    while (!que.empty()) {
      int u = que.front();
      que.pop();
      for (int v = 0; v < n; ++v) {
        if (s[u][v] == '1' && dist[v] == 0) {
          dist[v] = dist[u] + 1;
          que.push(v);
        }
      }
    }
    i64 res = 0;
    for (int u = 0; u < n; ++u) res = max(res, dist[u]);
    ans = max(ans, res);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
int main(){ 
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a*b>c*d){
        cout<<a*b;
    }else if(a*b<c*d){
        cout<<c*d;

    }else{
        cout<<a*b;
    }
    return 0;
}


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

double h[3005];
double t[3005]; 
double dp[3005][3005];
double ans;

int main(){
	int n;
	cin >> n;
	dp[0][0] = 1;
	
	for(int i = 0; i < n; i++){
		cin >> h[i];
		t[i] = 1 - h[i];
		dp[i+1][0] = t[i] * dp[i][0]; 
	}
	
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			dp[i][j] = dp[i-1][j-1]* h[i-1] + dp[i-1][j] * t[i-1];
		}			
	}
	
	for(int i = n/2+1; i <= n; i++){
		ans += dp[n][i];
	}
	
	cout << fixed << setprecision(10) << ans << endl;
	
}


Measured memory_bytes: 70656
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())


int n, k;
vector<int> edge[100000];


int a[100000];



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

	scanf("%d", &n);
	rep(i,n-1) {
		int a, b;
		scanf("%d%d", &a, &b);
		a--; b--;
		edge[a].push_back(b);
		edge[b].push_back(a);
	}
	auto cmp = [](const pair<int, int> &a, const pair<int, int> &b) {return a.first < b.first; };
	priority_queue < pair<int, int>, vector<pair<int, int>>, decltype(cmp)> pq(cmp);

	fill_n(a, n, INF);
	scanf("%d", &k);
	rep(i,k) {
		int v, p;
		scanf("%d%d", &v, &p);
		v--;
		a[v] = p;
		pq.emplace(p, v);
	}
	while (!pq.empty()) {
		int v, p;
		tie(p, v) = pq.top();
		pq.pop();
		for (int u : edge[v]) {
			if (a[u]==INF) {
				a[u] = p - 1;
				pq.emplace(p - 1, u);
			}
			else if (abs(a[u] - a[v]) != 1) {
				puts("No");
				return 0;
			}
		}
	}
	puts("Yes");
	rep(i, n)printf("%d\n", a[i]);

	
	return 0;
}

Measured memory_bytes: 7924
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
//const ll MOD = 1000000007;
const ll MOD = 998244353;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


void solve(){
    string S;
    cin >> S;
    int N = S.size();
    REP(i,N-1) if(S[i] == S[i+1]){
        cout << i+1 << " " << i+2 << endl;
        return;
    }
    REP(i,N-2) if(S[i] == S[i+2]){
        cout << i+1 << " " << i+3 << endl;
        return;
    }
    cout << -1 << " " << -1 << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    // int T; cin >> T; REP(t,T) solve();
}


Measured memory_bytes: 512
#include <stdio.h>

int main(){
  int n,ans=0,final=0;
  int i,k;
  scanf("%d",&n);
  int aup[100],adown[100];
  for(i=0;i<n;i++){
    scanf("%d",&aup[i]);
  }
  for(i=0;i<n;i++){
    scanf("%d",&adown[i]);
  }
  for(i=0;i<n;i++){
    for(k=0;k<i;k++){
      ans += aup[k];
    }
    for(k=i;k<n;k++){
      ans += adown[k];
    }
    ans += aup[i];
    if(ans>final){
      final = ans;
    }
    ans = 0;
  }
  printf("%d",final);
  return 0;
}

Measured memory_bytes: 128
import numpy as np

N, D = map(int, input().split())
l = []
ans = 0
for i in range(N):
  l.append([int(x) for x in input().split()])
for i in range(N-1):
  for j in range(i+1, N):
    d = 0
    for k in range(D):
      d += (l[i][k] - l[j][k]) ** 2
    d = np.sqrt(d)
    if d % 1 == 0:
      ans += 1
print(ans)

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

int main(){
    ll N,M,K;
    cin >> N >> M >> K;
    vector<ll> A(N+1),B(M+1);

    ll b=0;
    A[0]=0;B[0]=0;
    //Aがどれだけ読めるかのマックスを取っておく
    rep(i,N){
        int x;
        cin >> x;
        A[i+1] += A[i] + x;
    }
    rep(i,M){
        int x;
        cin >> x;
        B[i+1] += B[i] + x;
    }

    //aが０のときBを上から
    for(int i=M; i>=0; i--){
        if(B[i]<=K){
            b=i;
            break;
        }
    }
    ll ans=0;
    //a全探索
    for(int i=0; i<=N; i++){
        for(int j=b; j>=0; j--){
            if(A[i]+B[j]<=K){
                ans = max(ans, (long long)i+j);
                b=j;
                break;
            }
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 6412
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,n,i;
    cin >> x;
    n=x;
    for( i=1;;i++)
    {
        if(n%360==0 || n==0)
            break;
        else
        {
            n+=x;
            if(n>360)
                n-=360;
        }
    }
    cout << i << endl;
}


Measured memory_bytes: 3628
import sys

input = sys.stdin.readline


def main():
    N, W = map(int, input().split())
    wv = [None] * N
    for i in range(N):
        wv[i] = tuple(map(int, input().split()))

    dp = [[0] * (W + 1) for _ in range(N + 1)]
    for i, (w, v) in enumerate(wv, start=1):
        dp_i = dp[i]
        dp_im = dp[i - 1]
        for j in range(1, W + 1):
            if j < w:
                dp_i[j] = dp_im[j]
            else:
                a = dp_im[j - w] + v
                b = dp_im[j]
                if a > b:
                    dp_i[j] = a
                else:
                    dp_i[j] = b

    ans = dp[-1][-1]
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 493196
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 4e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//

int main() {
    init();
    ll V, E;
    cin >> V >> E;
    vvc<ll> G(V, vl(V, INF)), dp(1 << V, vl(V, INF));
    rep(i,E){
        ll s, t, d;
        cin >> s >> t >> d;
        G[s][t] = d;
    }

    dp[0][0] = 0;

    rep(bit, 1<<V){
        rep(u, V){
            if(!(1<<u & bit))rep(v, V){
                if(v!=u) chmin(dp[bit | 1 << u][u], dp[bit][v] + G[v][u]);
            }
        }
    }

    ll ans = dp[(1 << V) - 1][0];
    cout << (ans == INF ? -1 : ans) << endl;
}


Measured memory_bytes: 7904
#include <iostream>
#include <cstdio>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <map>
#include <algorithm>
#include <limits.h>

#include <sstream>
using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    auto data = vector<int>(n, 0);
    for (int i = 0; i < n; i++) {
        scanf("%d", &data[i]);
    }

    auto lmax = vector<int>(n, 0);
    auto rmax = vector<int>(n, 0);

    int f = INT_MIN, s = INT_MIN;
    for (int i = 0; i < n; i++) {
        lmax[i] = f;

        if (data[i] > f) {
            s = f;
            f = data[i];
        } else if (data[i] > s) {
            s = data[i];
        }
    }

    f = INT_MIN, s = INT_MIN;
    for (int i = n - 1; i >= 0; i--) {
        rmax[i] = f;

        if (data[i] > f) {
            s = f;
            f = data[i];
        } else if (data[i] > s) {
            s = data[i];
        }
    }

    for (int i = 0; i < n; i++) {
        printf("%d\n", max(lmax[i], rmax[i]));
    }

    return 0;
}


Measured memory_bytes: 3968
var
	k,a,b:int64;
begin
	read(k,a,b);
	if b-a<=2 then begin
		writeln(k+1);
		exit;
	end;
	if a>k+1 then begin
		writeln(k+1);
		exit;
	end;
	writeln(A+(k-a+1)div 2*(b-a)+(k-a+1)mod 2);
end.


Measured memory_bytes: 128
n,m = map(int,input().split())
pyl = [list(map(int,input().split())) for nesya in range(m)]
predic = dict()
ydic = dict()
spyl = sorted(pyl,key = lambda x:x[1])
for py in spyl:
  p = py[0]
  y = py[1]
  if p in predic:
    predic[p] += 1
  else:
    predic[p] = 1
  ydic[y] = (str(p).zfill(6))+(str(predic[p]).zfill(6))
for hoge in pyl:
  print(ydic[hoge[1]])

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

for i in range(k):
        print(a)
        a = a + 1
        if a > b:
                break
if a > (b - k + 1):
        large_start = a
else:
        large_start = b - k + 1

for i in range(k):
        if large_start > b:
                break
        print(large_start)
        large_start = large_start + 1

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
    double d, t, s;
    cin >> d >> t >> s;
    if(d / s <= t) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3720
a,b,x=map(int,input().split())
import math
pii=math.pi
if x<=(a*a*b)/2:
    y=2*x/(b*a)
    tantheta=b/y
    ans=math.atan(tantheta)*(360/(2*pii))
    print(ans)
else:
    x=a*a*b-x
    #print(x,'x')
    y=(2*x/(a*a))
    tantheta=y/a
    ans=math.atan(tantheta)*(360/(2*pii))
    print(ans)
    


Measured memory_bytes: 3060
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn print<T: std::fmt::Display>(x: T) -> () {
    println!("{}", x);
}


fn main() {
    let abc: Vec<i64> = read_vec();
    let a = abc[0];
    let b = abc[1];
    let c = abc[2];

    if (a < c && c < b) || (b < c && c < a) {
        print("Yes");
    } else {
        print("No");
    }
}


Measured memory_bytes: 4352
import java.util.*; 
public class Main{
	static public void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int[] num={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
		int k=sc.nextInt()-1;
		System.out.print(num[k]);
		sc.close();
	}
}

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

using namespace std;
 
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
 
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<bool> VB;

int main() {
    int n,k,q;
    cin >> n >> k >> q;
    VI a(q,0);
    VI b(n,0);
    rep(i,q) {
        cin >> a[i];
    }

    rep(i,q) {
        b[a[i]-1] += 1;
    }

    rep(i,n) {
        b[i] -= q;
        b[i] += k;
    }

    rep(i,n) {
        if(b[i]<=0) {
            cout << "No" << endl;
        } else {
            cout << "Yes" << endl;
        }
    }
    return 0;
    
}

Measured memory_bytes: 1408
n,x,y=map(int,input().split())
x-=1
y-=1
half=(x+y)//2
ans=[0]*n
for i in range(n):
    for j in range(i,n):
        if i<=x:
            if j<=half:
                ans[j-i]+=1
            else:
                ans[x-i+1+abs(y-j)]+=1
        elif x<i and i<=y:
            ans[min(j-i,i-x+1+abs(y-j))]+=1
        else:
            ans[j-i]+=1
for i in range(1,n):
    print(ans[i])


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

int main() {
  int N;
  cin >> N;
  vector<string> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
    if (vec.at(i) == "Y") {
      cout << "Four" << endl;
      return 0;
    }
  }
  cout << "Three" << endl;
}

Measured memory_bytes: 256
N = int(input())
s = input()

maxx = 0

for i in range(N - 1):
    left = s[: i + 1]
    right = s[i + 1 :]
    
    and_LR = set(left) & set(right)
    cnt = len(and_LR)
    
    maxx = max(maxx, cnt)
    
print(maxx)


Measured memory_bytes: 3064
n = int(input())
h = list(map(int, input().split(" ")))
h.append(10 ** 9 + 1)

ans = []
count = 0
for i in range(n):
    if h[i] >= h[i+1]:
        count += 1
    else:
        ans.append(count)
        count = 0
print(max(ans))

Measured memory_bytes: 14252
package main

import (
        "fmt"
)

func solution(n int, a []int) []int {
        var colors [9]int
        for i := range a {
                switch {
                case a[i] < 400:
                        colors[0]++
                case a[i] < 800:
                        colors[1]++
                case a[i] < 1200:
                        colors[2]++
                case a[i] < 1600:
                        colors[3]++
                case a[i] < 2000:
                        colors[4]++
                case a[i] < 2400:
                        colors[5]++
                case a[i] < 2800:
                        colors[6]++
                case a[i] < 3200:
                        colors[7]++
                default:
                        colors[8]++
                }
        }
        lo, hi := 0, 0

        for i := 0; i < 8; i++ {
                if colors[i] > 0 {
                        lo++
                }
        }
        hi = lo + colors[8]
        if lo == 0 && hi != 0 {
                lo = 1
        }
        return []int{lo, hi}
}

func main() {
        var n int
        fmt.Scan(&n)
        a := make([]int, n)
        for i := range a {
                fmt.Scan(&a[i])
        }
        out := solution(n, a)
        fmt.Printf("%v %v\n", out[0], out[1])
}

Measured memory_bytes: 512
#include<stdio.h>

#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) > (b) ? (b) : (a))

int main(){
  int n;
  scanf("%d", &n);
  
  long long a[n];
  for(int i = 0; i < n; i++) scanf("%lld", a + i);
  
  long long initial_plus = max(1 - a[0], 0);
  long long initial_minus = max(1 + a[0], 0);
  
  long long sum = 0;
  
  //初項を正にした場合
  sum = max(a[0], 1);
  for(int i = 1; i < n; i++){
    if((sum + a[i]) * sum >= 0ll){
      if(sum < 0ll){
        initial_plus += 1 - sum - a[i];
        sum = 1;
      }else{
        initial_plus += sum + a[i] + 1;
        sum = -1;
      }
    }else{
      sum += a[i];
    }
  }
  
  //初項を負にした場合
  sum = min(a[0], -1);
  for(int i = 1; i < n; i++){
    if((sum + a[i]) * sum >= 0ll){
      if(sum < 0ll){
        initial_minus += 1 - sum - a[i];
        sum = 1;
      }else{
        initial_minus += sum + a[i] + 1;
        sum = -1;
      }
    }else{
      sum += a[i];
    }
  }
  
  printf("%lld\n", min(initial_plus, initial_minus));
  
  return 0;
}

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

#define ll long long
#define mod 1000000007
#define pii pair<ll,ll>

#define debug(a) { cout << #a << " = " << a << endl;}

const int maxn = 1e5+1;
ll arr[maxn], n, m, t, k;
unordered_map<ll,ll> u;

ll __min(ll a, ll b) {
    return a < b ? a : b;
}

ll __max(ll a, ll b) {
    return a > b ? a : b;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    cin>>n>>m>>t;
    if (t*m >= n) cout << "Yes\n";
    else cout << "No\n";
}


Measured memory_bytes: 3616
#include<stdio.h>
int count;
long long int cb, cw;
int h, w;
char s[402][402];
int visited[402][402];
void dfs(int x, int y, int k)
{
	visited[x][y] = k;
	count++;
	if (s[x][y] == '#')
		cb++;
	else
		cw++;
	if (x > 0)
		if (s[x][y] != s[x - 1][y] && visited[x - 1][y] == 0)
			dfs(x - 1, y, k);
	if (y > 0)
		if (s[x][y] != s[x][y - 1] && visited[x][y - 1] == 0)
			dfs(x, y - 1, k);
	if (x < h - 1)
		if (s[x][y] != s[x + 1][y] && visited[x + 1][y] == 0)
			dfs(x + 1, y, k);
	if (y < w - 1)
		if (s[x][y] != s[x][y + 1] && visited[x][y + 1] == 0)
			dfs(x, y + 1, k);
	return;
}
int main()
{
	scanf("%d %d", &h, &w);
	int i, j;
	for (i = 0; i < h; i++)
		scanf("%s", s[i]);
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			visited[i][j] = 0;
	int k = 1;
	long long int ans = 0;
	for (i = 0; i < h; i++)
	{
		for (j = 0; j < w; j++)
		{
			if (visited[i][j] == 0)
			{
				cw = cb = 0;
				dfs(i, j, k);
				ans += cw * cb;
				k++;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}

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


int main(void){
    int h,w;
    cin >> h >> w;

    int array[h][w];

    int n = 0;
    vector<string> str;

    int buf,i,j,flag=0;
    int y1,x1;

    for(i=0; i<h; i++){
        for(j=0; j<w; j++){
            cin >> buf;
            array[i][j] = buf%2;
        }
    }


    for(i=0; i<h; i++){
       if(i%2 == 0){
           for(j=0; j<w; j++){
                if(flag == 0 && array[i][j] == 1){
                    y1 = i;
                    x1 = j;
                    flag = 1;
                }else if(flag == 1){
                    str.push_back(to_string(y1+1)+" "+to_string(x1+1)+" "+to_string(i+1)+" "+to_string(j+1));
                    n++;
                    y1 = i;
                    x1 = j;
                    if(array[i][j] == 1){
                        flag = 0;
                    }
                }
            }
       }else{
           for(j=w-1; j>=0; j--){
               if(flag == 0 && array[i][j] == 1){
                    y1 = i;
                    x1 = j;
                    flag = 1;
                }else if(flag == 1){
                    str.push_back(to_string(y1+1)+" "+to_string(x1+1)+" "+to_string(i+1)+" "+to_string(j+1));
                    n++;
                    y1 = i;
                    x1 = j;
                    if(array[i][j] == 1){
                        flag = 0;
                    }
                }
            }
        }
    }

    cout << n << endl;
    for(i=0; i<n; i++){
        cout << str.at(i) << endl;
    }

    return 0;
}

Measured memory_bytes: 11892
import itertools

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():

    N, K = ZZ()
    S = input()
    gr = itertools.groupby(S)
    l = []
    c = 0
    for i, j in gr:
        l.append([int(i), len(list(j))])
        if i == '0': c += 1
    if c <= K:
        print(N)
        return
    output = 0
    left = right = 0
    sum = c = 0
    while left < len(l):

        while right < len(l) and c < K:
            if l[right][0] == 0: c += 1
            sum += l[right][1]
            right += 1
        if right < len(l) and l[right][0] == 1:
            sum += l[right][1]
            right += 1
        output = max(output, sum)
        if right == left:
            right += 1
            left += 1
        else:
            if l[left][0] == 0: c -= 1
            sum -= l[left][1]
            left += 1
            while left < len(l) and c >= K:
                if l[left][0] == 0: c -= 1
                sum -= l[left][1]
                left += 1
    print(output)

    return

if __name__ == '__main__':
    main()


Measured memory_bytes: 13812
# -*- coding: utf-8 -*-

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

A.sort(reverse=True)
#print(A)

"""
ans = 0
list = []
for i in range(N):
  if ( i==0 ) :
    list.append(A[0])
  else:
    max_index = list.index(max(list))
    ans += list[max_index]
    list[max_index] = A[i]
    list.insert(max_index, A[i])
  #print(list,ans)
"""

ans = 0
for i in range(N):
  if ( i==0 ) :
    ans += 0
  else:
    ans += A[i//2]

print(ans)

Measured memory_bytes: 30968
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

constexpr ll infl = 10000000000000000LL;
constexpr int inf = 1000000000;

int main() {
    int n, wmax;
    cin >> n >> wmax;
    vector<int> w(n), v(n);
    int w0;
    int kmax = 0;
    for (int i = 0; i < n; ++i) {
        cin >> w[i] >> v[i];

        if (i == 0)
            w0 = w[0];

        w[i] -= w0;
        kmax += w[i];
    }

    vector<vector<vector<int>>> dp(n, vector<vector<int>>(n + 1, vector<int>(4 * n)));
    for (int i = 0; i < n; ++i) {
        for (int j = 1; j <= i + 1; ++j) {
            for (int k = 0; k < 4 * n; ++k) {
                if (i > 0) {
                    if (i >= j) {
                        dp[i][j][k] = dp[i - 1][j][k];
                    }

                    if (k - w[i] >= 0) {
                        dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k - w[i]] + v[i]);
                    }
                } else {
                    dp[i][j][k] = v[i];
                }
            }
        }
    }

    int ans = 0;
    for (int j = 0; j <= n; ++j) {
        ll idx = min((ll)wmax - (ll)w0 * (ll)j, (ll)kmax);
        if (idx >= 0)
            ans = max(ans, dp.back()[j][idx]);
    }

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

Measured memory_bytes: 16640
/*  CREATED BY
    Stream_Cipher
    13-sep-2020
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
#define debug1(a) cout<<#a<<"="<<(a)<<"\n"
#define debug2(a,b) cout<<#a<<"="<<(a)<<","<<#b<<"="<<(b)<<"\n"
#define debug3(a,b,c) cout<<#a<<"="<<(a)<<","<<#b<<"="<<(b)<<","<<#c<<"="<<(c)<<"\n"
#define fix_precision(n) cout<<fixed<<setprecision(n)
#define all(a) a.begin(),a.end()
const double pi=acos(-1.0);
int inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int mx=5*1000000;//5*64M bit ->5*8M byte ->40MB size for long long int (64 bit)
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif 	
        int x,k,dis;
        cin>>x>>k>>dis;
        x=abs(x);
        if(x/dis>=k)
        	cout<<x-k*dis<<endl;
        else
        {
        	// cout<<"ASF\n";
        	int mx=x-(x/dis)*dis;
        	int mn=abs(mx-dis);
        	int ans;
        	k-=(x)/dis;
        	if(k%2==0)
        		ans=mx;
        	else
        		ans=mn;
        	cout<<ans<<endl;
        }
}

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

#define int long long

using namespace std;

signed main()
{
    int N, A[200005];
    
    cin >> N;

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

    sort(A, A + N);

    int b = A[N / 2];

    int ans = 0;

    for (int i = 0; i < N; i++) { ans += abs(A[i] - b); }
    cout << ans << endl;

    return 0;
}

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

public class Main {
	public static void main(String[] args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String line[] = br.readLine().split(" ");
			int n = Integer.parseInt(line[0]);
			if(n==0){break;}

			run(n,n,"");
		}
	}

	static void run(int n, int limit, String ans){
		for(int i=limit;i>0; i--){
			String out = ans;
			if(n == i){
				out += i;
				System.out.println(out);
			}else{
				int newlimit = Math.min(n-i, i);
				out += i+" ";
				run(n-i,newlimit,out);
			}
		}
	}
}

Measured memory_bytes: 42680
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  int i;
  cin>>s;

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

  for(i=0;i<s.length()-1;i++){
    if(s[i]==s[i+1]){cout<<"no"<<endl;return 0;}
  }
  cout<<"yes";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define cs const
#define pb push_back
using namespace std;
cs int N = 2e6 + 50;
cs int INF = 1e9 + 7;
int n, m, k; char A[N], B[N];
queue<int> a, b, oa, ob;
int Fir(cs queue<int> &a){ return a.empty() ? INF : a.front(); }
void work(int x){
	if(a.empty() && b.empty()) return;
	int ta = Fir(a), tb = Fir(b);
	if(ta == tb){
		a.pop(); b.pop();
		if(A[x]=='1'){
			if(ta<=k) oa.push(ta), A[x]='0'; 
		} else A[x]='1';
		if(B[x]=='1'){
			if(tb<=k) ob.push(tb), B[x]='0'; 
		} else B[x]='1';
	} else if(ta < tb){
		a.pop(); if(A[x]=='0') A[x]='1';
		else if(ta<=k) oa.push(ta), A[x]='0'; 
	} else{
		b.pop(); if(B[x]=='0') B[x]='1';
		else if(tb<=k) ob.push(tb), B[x]='0';
	} if(A[x]=='1' && B[x]=='1'){
		int t = min(ta,tb);
		if(t+1<=k) oa.push(t+1), ob.push(t+1), A[x]=B[x]='0';
	} work(x);
}
int main(){
	#ifdef FSYolanda
	freopen("1.in","r",stdin);
	#endif
	scanf("%d%d%d",&n,&m,&k);
	scanf("%s%s",A+1,B+1); 
	reverse(A+1,A+n+1);
	reverse(B+1,B+m+1);
	int fn=max(n,m)+k; 
	for(int i=n+1; i<=fn; i++) A[i]='0';
	for(int i=m+1; i<=fn; i++) B[i]='0';
	for(int i=1; i<=fn; i++){
		if(A[i]=='1' && B[i]=='1')
		A[i] = '0', B[i] = '0', oa.push(1), ob.push(1); 
		work(i); swap(oa,a); swap(ob,b);
	} 
	for(int i=fn,ok=0; i>=1; i--){
		if(A[i]=='1') ok=1;
		if(ok) cout<<A[i];
	} puts("");
	for(int i=fn,ok=0; i>=1; i--){
		if(B[i]=='1') ok=1;
		if(ok) cout<<B[i];
	} return 0;
}

Measured memory_bytes: 8064
n=int(input())
a=list(input().split())
ans=1
f=0
i=0
while(i<n):
    if f==0:
        ans=ans*int(a[i])
    if f==0 and ans>1000000000000000000:
        f=1
    if int(a[i])==0:
        print(0)
        exit()
    i+=1
if f==1:
    print(-1)
    exit()
print(ans)

Measured memory_bytes: 19436
#include<bits/stdc++.h>
using namespace std; 
using ll=long long;
#define endl "\n"
#define F(i,n) for(ll i=0;i<n;i++)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repp(i,a,b) for(ll i=a;i>=b;i--)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ALL(v) v.begin(),v.end()
void solve(){
    
     ll N,D,cnt=0;
     cin>>N>>D;
     cout<<ceil(N/(double)(2*D+1));
}
signed main(){
    fast;
     
    solve();
 
    return 0;
}

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

using namespace std;

int main(){
  string S;
  cin >> S;
  string K = "keyence";
  bool boolean = false;
  int Slen = S.length();

  // keyencexxxxx
  bool booltmp = true;
  for(int i = 0; i < 7; i++){
    if(S[i] != K[i]) booltmp = false;
  }
  if(booltmp) boolean = true;

  // xxxxxkeyence
  booltmp = true;
  for(int i = 0; i < 7; i++){
    if(S[Slen-7+i] != K[i]) booltmp = false;
  }
  if(booltmp) boolean = true;


  // keyxxxxxence

  for(int j = 1; j < 7; j++){
    booltmp = true;
    for(int i = 0; i < 7; i++){
      if(i < j){
        if(S[i] != K[i]) booltmp = false;
      }else{
        if(S[Slen-7+i] != K[i]) booltmp = false;
      }

    }
    if(booltmp) boolean = true;
  }


  if(boolean){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 string S;
  cin >> S ;
  
    if(S.at(0) == S.at(1) && S.at(1) == S.at(2)){
      cout << "No" << endl;
    }else{
      cout << " Yes" << endl;
    }
}

Measured memory_bytes: 256
x, y = gets.split

h = {'A' => 10, 'B' => 11, 'C'=>12,'D'=>13,'E'=>14, 'F'=>15}

ret =
  if h[x] < h[y]
    '<'
  elsif h[x] == h[y]
    '='
  else
    '>'
  end

puts ret

Measured memory_bytes: 1788
/* I have already deleted My old account because somebody stole my code
and i have no idea how. If you are copying this code atleast make it look different 
Yours Faithfully
Shobhit Yadav */

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

ll M,N;
/*ll freq[200005];*/
void solve(){
	 /*memset(freq,0,sizeof(freq));*/
  ll temp;
  set<ll> S;
  for(ll i = 0 ; i<3 ; i++){
    cin>>temp;
    S.insert(temp);
  }


if(S.size() == 2)
  cout<<"Yes"<<'\n';


else
  cout<<"No"<<'\n';



}



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

	return 0;
}


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

    long long a,b,k;
    cin >> a >> b >> k;

    long long aAns,bAns;
    if(a <= k){
        aAns = 0;
        if(k - a > b){
            bAns = 0;
        }else{
            bAns = b - (k -a);
        }
    }else{
        aAns = a -k;
        bAns = b;
    }

    cout << aAns << " " << bAns << endl;

}

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

int main(){
  int N,K;
  cin>>N;
  string S;
  cin>>S;
  cin>>K;
  char sk=S[K-1];
  //cout<<sk<<endl;
  for(int i=0;i<N;i++){
    if (S[i]==sk){
      cout<<sk;
    }else{
      cout<<"*";
    }
	
    
  }
  cout<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#define ele long
using namespace std;
ele a,b;
ele gcd(ele a,ele b){
	if (b==0) return a;
	return gcd(b,a%b);
}
inline ele lcm(ele a,ele b){ return a/gcd(a,b)*b; }
int main(){
	while (~scanf("%d%d",&a,&b)) printf("%d %d\n",gcd(a,b),lcm(a,b));
	return 0;
}

Measured memory_bytes: 1024
s = input()

flag = False
for i in range(len(s)//2):
    if s[i] != s[len(s)-i-1]:
        flag = True

for i in range((len(s)//2)//2+1):
    if s[i] != s[len(s)//2-i-1]:
        flag = True

if flag:
    print("No")
else:
    print("Yes")


Measured memory_bytes: 2940
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

ll mod(ll a){
  return a % 1000000007;
}

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


int main(){
  ll r,d,x; cin >> r >> d >> x;
  
  for(ll i=0; i < 10; i++){
    
    cout << r*x - d << endl;
    x = r*x - d;
  }
  
}

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

using P = pair<ll, int>;

ll dp[2020][2020];

int main(void){
    int n;
    cin >> n;
    vector<ll> a(n);
    vector<P> p(n);
    rep(i,n) {
        cin >> a[i];
        p[i] = {a[i], i};
    }
    sort(all(p),greater<P>());
    rep(i,n){
        int pos = p[i].second;
        // 左右合計iこ埋め済み
        rep(l,i+1){
            int r = i-l;
            // lこ埋め済み, rこ埋め済み
            if (l < n) {
                dp[l+1][r] = max(dp[l+1][r], dp[l][r] + a[pos] * abs(l-pos));
            }
            if (r < n) {
                dp[l][r+1] = max(dp[l][r+1], dp[l][r] + a[pos] * abs(n-1-r-pos));
            }
        }
    }
    ll res = 0;
    rep(l,n+1) {
        int r = n-l;
        res = max(dp[l][r],res);
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 26348
function sub(foo) {
	foo = parseInt(foo);
    var str = "";
    if (foo == 25) {
        str = "Christmas";
    }
    if (foo == 24) {
        str = "Christmas Eve"
    }
    if (foo == 23) {
        str = "Christmas Eve Eve";
    }
    if (foo == 22) {
        str = "Christmas Eve Eve Eve";
    }
    return str;
}

function Main(ab) {
    console.log(sub(ab));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define all(a) (a).begin(),(a).end()
#define SORT(a) sort(all(a))
#define rSORT(a, i) sort(all(a),(i))

using ll = long long;
constexpr ll INF = 10000000000;
constexpr ll MOD = 1000000007;

using namespace std;

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

	vector<int> a(m), b(m);
	for (int i = 0; i < m; i++) {
		cin >> a[i] >> b[i];
		a[i]--; b[i]--;
	}

	int ans = 0;

	rep(i, m) {
		vector<vector<int>>to(n);
		vector<int>dis(n, -1);
	
		rep(j, m) {
			if (i != j) {
				to[a[j]].push_back(b[j]);
				to[b[j]].push_back(a[j]);
			}
		}

		queue<int>bfs;
		bfs.push(0);
		dis[0] = 0;

		while (!bfs.empty()) {
			int now = bfs.front();
			bfs.pop();

			for (int next : to[now]) {

				if (dis[next] != -1)continue;

				bfs.push(next);
				dis[next] = dis[now] + 1;
			}
		}
		bool okay = false;
		rep(j, n) {
			if (dis[j] == -1) {
				okay = true;
			}
		}
		if (okay)ans++;
	}
	cout << ans << endl;
}



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

int main() {
  int A, B;
  cin >> A >> B;
  vector<int> cnt(3);
  cnt[0] = A+B;
  cnt[1] = A-B;
  cnt[2] = A*B;
  sort(cnt.begin(), cnt.end());
  cout << cnt[2] <<endl;
}


Measured memory_bytes: 3548
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define to_s to_string
#define len(v) (int)v.size()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define print(x) cout << (x) << '\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
ll MOD = 1e9 + 7;
ll devc(ll x, ll y) { return 1 + (x - 1) / y; }

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

    ll N;
    cin >> N;

    ll L[100];
    L[0] = 2, L[1] = 1;

    for (int i = 2; i <= N; ++i) L[i] = L[i - 1] + L[i - 2];

    print(L[N]);

    return 0;
}

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

#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)

using namespace std;

#define del ' '
#define x first
#define y second
#define ll long long


class union_find {
public:
   union_find(int n)
      : par_(n, -1)
   {}
   void init(int n) {
      par_.assign(n, -1);
   }

   int root(int x) {
      return par_[x] < 0 ? x : par_[x] = root(par_[x]);
   }

   bool unite(int x, int y) {
      x = root(x); y = root(y);
      if (x == y) {
         return false;
      }
      else {
         if (par_[x] < par_[y]) {
            par_[x] += par_[y];
            par_[y] = x;
         }
         else {
            par_[y] += par_[x];
            par_[x] = y;
         }
         return true;
      }
   }

   bool same(int x, int y) {
      return root(x) == root(y);
   }

   int size(int x) {
      return -par_[root(x)];
   }

private:
   std::vector<int> par_;
};


void solve();

int main() {

   solve();
   return 0;

}

void solve() {

   string s;
   int h,w;
   cin >>h>>w;
   vector<string> v(h);
   REP(i, h) {

      cin >> v[i];

   }
   REP(i, w+2) {

      s+="#";

   }
   
   cout << s<<endl;;
   REP(i, h) {

      cout << "#" << v[i] << "#" << endl;

   }
   cout << s << endl;

}

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

int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	for (int& a : A) cin >> a;
	sort(begin(A), end(A));
	reverse(begin(A), end(A));
	int64_t ans = 0;
	queue<int> Q;
	Q.push(A[0]);
	for (int i = 1; i < A.size(); ++i) {
		// cout << Q.front() << " " << A[i] << endl;
		ans += Q.front();
		Q.pop();
		Q.push(A[i]);
		Q.push(A[i]);
	}
	cout << ans << endl;
}

Measured memory_bytes: 4844
#include<bits/stdc++.h>
#define N 100005
using namespace std;
int n,a[N],ss[N];
char s[N];
int main() {
	scanf("%d %s",&n,s);
	for(int i=0;i<n;i++)
		ss[i]=(s[i]=='o');
	for(int i=0;i<2;i++) {
		for(int j=0;j<2;j++) {
			a[0]=i;a[1]=j;
			for(int k=1;k<n-1;k++) {
				if(a[k]) {
					if(ss[k]) {
						a[k+1]=!a[k-1];
					}
					else {
						a[k+1]=a[k-1];
					}
				}
				else {
					if(ss[k]) {
						a[k+1]=a[k-1];
					}
					else {
						a[k+1]=!a[k-1];
					}
				}
			}
			if(a[n-1]) {
				if(ss[n-1]) {
					a[0]=!a[n-2];
				}
				else {
					a[0]=a[n-2];
				}
			}
			else {
				if(ss[n-1]) {
					a[0]=a[n-2];
				}
				else {
					a[0]=!a[n-2];
				}
			}
			if(a[0]) {
				if(ss[0]) {
					a[1]=!a[n-1];
				}
				else {
					a[1]=a[n-1];
				}
			}
			else {
				if(ss[0]) {
					a[1]=a[n-1];
				}
				else {
					a[1]=!a[n-1];
				}
			}
			if(a[0]==i && a[1]==j) {
				for(int k=0;k<n;k++)
					printf("%c",a[k]?'W':'S');
				return 0;
			}
		}
	} 
	printf("-1");
}


Measured memory_bytes: 1152
'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {

	var lines = chunk.toString().split('\n');
	var result = (function(number) {
		return Range(1,number)
		.filter(function(v) {
			return ((v % 3 === 0) 
				|| (function(num) {
					var digit = num;
					while (digit > 0) {
						if (digit % 10 === 3) return true;
						digit = ~~(digit / 10);
					}
					return false;
				}(v))); 
		}).join(' ');
	}(parseInt(lines[0],10)));

	console.log('',result);

	function Range(begin,end) {
		var result = [];
		for (var i = begin; i <= end; i++) {
			result.push(i);
		}
		return result;
	}
});

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

int main() {
  int N;
  cin >> N;
  
  string str = to_string(N);
  
  int digitSum = 0;
  for (char c : str) {
    digitSum += c - '0';
  }
  if (N % digitSum == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3668
#include <iostream>
#include <string>
using namespace std;
int main(){
	int n ,save[1000] ,o=0 ,p=0 ,m=0 ,ans=0 ,num=0;
	string s ,j ,a;
	cin>>n;
	cin>>s;
	for(int i=0;i<n;i++){
		ROOP:
		o=0;
		p=0;
		m=0;
		cin>>a;
		for(int x=0;x<a.size();x++){
			if(s[0]==a[x]){
				save[o]=x;
				o++;
			}
		}
		for(int p=0;p<o;p++){
			for(int x=1;x<a.size();x++){
				if(save[p]+x+x<a.size()){
				j=a[save[p]];
				num=save[p];
				for(int y=0;y<s.size()-1;y++){
				num+=x;
				j+=a[num];
				}
					if(j==s){
					ans++;
					i++;
					if(i==n){
					cout<<ans<<endl;
					return 0;
					}
					goto ROOP;
					}
				}
			}
			j.erase();
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1220
import java.util.Scanner;
public class Main {
    public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[]p = new int[n];
    
    int cou = 0;
    for(int i=0; i<n; i++) {
    	p[i] = sc.nextInt();
    }
    for(int i=0; i<n-2; i++) {
    	if(p[i+1]<p[i] && p[i+1]>=p[i+2]) {
    			cou++;
    	}
    		if(p[i+1]>=p[i] && p[i+1]<p[i+2]) {
    	    	cou++;
    	}
    }
    		System.out.println(cou);
      }
}


Measured memory_bytes: 35608
#include <math.h>
#include <stdio.h>
#include <string.h>
int ans = 0;
char a[999999], b[999999];
int main(void) {
    scanf("%s", a);
    scanf("%s", b);
    for (int i = 0; i < strlen(a); i++) {
        if (a[i] != b[i]) {
            ans = ans + 1;
        }
    }
    printf("%d\n", ans);
}

Measured memory_bytes: 2096