akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main(void){
 
    int X;
    cin >> X;
    
    int a,b;
    
    a = X/100;
    b = X%100;
    
    int ans = 0;
    
    //cout << a*5 << ":" << b << endl;
    if(a*5>=b)ans = 1;
    
    cout << ans << endl;
    
}
 

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>

#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
using namespace std;

int N;
int a[50];

signed main()
{
	cin >> N;
	REP(i, N) cin >> a[i];

	int max = INT_MIN;
	int min = INT_MAX;
	int max_index = -1;
	int min_index = -1;

	REP(i, N)
	{
		if (a[i] > max)
		{
			max = a[i];
			max_index = i + 1;
		}
		if (a[i] < min)
		{
			min = a[i];
			min_index = i + 1;
		}
	}

	cout << 2 * N << endl;
	if (abs(max) > abs(min))
	{
		cout << max_index << " " << 1 << endl;
		cout << max_index << " " << 1 << endl;
		for (int i = 2; i <= N; i++)
		{
			cout << (i - 1) << " " << i << endl;
			cout << 1 << " " << i << endl;
		}
	}
	else
	{
		cout << min_index << " " << N << endl;
		cout << min_index << " " << N << endl;
		for (int i = N - 1; i >= 1; i--)
		{
			cout << (i + 1) << " " << i << endl;
			cout << N << " " << i << endl;
		}
	}
}



Measured memory_bytes: 256
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int[] a = new int[n];

    for (int i = 0; i < n; i++) {
      a[i] = sc.nextInt();
    }

    sc.close();

    // +-+-+...の場合
    long sum1 = 0;
    long count1 = 0;

    for (int i = 0; i < n; i++) {
      
      sum1 += a[i];

      if (i % 2 == 0) {
        if (sum1 <= 0) {
          count1 += (1 - sum1);
          sum1 = 1;
        }
      } else {
        if (0 <= sum1) {
          count1 += (sum1 + 1);
          sum1 = -1;
        }
      }

    }

    // -+-+_...の場合
    long sum2 = 0;
    long count2 = 0;

    for (int i = 0; i < n; i++) {
      
      sum2 += a[i];

      if (i % 2 == 0) {
        if (0 <= sum2) {
          count2 += (sum2 + 1);
          sum2 = -1;
        }
      } else {
        if (sum2 <= 0) {
          count2 += (1 - sum2);
          sum2 = 1;
        }
      }

    }

    System.out.println(Math.min(count1, count2));

  }

}

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

int main() {
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  string ans;
  rep(i,n) {
    ans += s[i];
    ans += t[i];
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
/* author: jeetganatra */

#include<bits/stdc++.h>
using namespace std;
 
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define fo(i,n)         for(int i=0;i<n;i++)
#define Fo(i,k,n)       for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             998244353
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define pw(b,p)         pow(b,p) + 0.1
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define endl            "\n"
#define PI              3.14159265
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

 
void jpg()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int mpow(int base, int exp); 


                                                                                                                                                                                                                             
int32_t main()
{
	jpg();
	int n;
    cin>>n;
    map<int, int> m;
    int sum = 0;
    fo(i,n)
    {
	    int ai;
	    cin>>ai;
	    ++m[ai];
	    sum += ai;
    }
    int Q;
    cin>>Q;
    while(Q--)
    {
	    int b, c;
	    cin>>b>>c;
	    if (m.find(b) == m.end()) 
	    {
	      cout<<sum<<endl;
	      continue;
	    }
  
	    int tmp = m[b];
	    sum -=tmp * b;
	    sum +=tmp * c;
	    m.erase(b);
	    m[c] += tmp;
	    cout<<sum<<endl;
    }
}


int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((int)result * base) % mod;
    base = ((int)base * base) % mod;
    exp >>= 1;
  }
  return result;
}



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


using namespace std;

struct D{
	int size;
	vector<int> num;

	D(){
		size = 6;
		num = vector<int>{1,2,3,4,5,6};
	}
	D(vector<int> _num){
		size = _num.size();
		num = _num;
	}
	void roll(char c){
		vector<int> idx{0,1,2,3,4,5};
		switch(c){
			case 'S':
				idx = vector<int>{4,0,2,3,5,1};
				break;
			case 'N':
				idx = vector<int>{1,5,2,3,0,4};
				break;
			case 'W':
				idx = vector<int>{2,1,5,0,4,3};
				break;
			case 'E':
				idx = vector<int>{3,1,0,5,4,2};
				break;
		}
		vector<int> ret(num);
		for(int i = 0; i < size; i++){
			ret[i] = num[idx[i]];
		}
		swap(ret,num);
	}
};
				

int main(){
	vector<int> a(6);
	for(auto &e : a)cin >> e;
	string s; cin >> s;
	D dice(a);
	for(auto e : s)dice.roll(e);
	cout << dice.num[0] << endl;

	return 0;
}



Measured memory_bytes: 3188
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
typedef long long LL;
const int N = 3e5 + 10;
int tr[N * 4], cnt[N];
vector<int>bomb[N];
void build(int x, int l, int r)
{
	if(l == r) 
	{
		tr[x] = cnt[l];
		return;
	}
	int mid = (l + r) >> 1;
	build(x * 2, l, mid);
	build(x * 2 + 1, mid + 1, r);
	tr[x] = max(tr[x * 2], tr[x * 2 + 1]);
}
void update(int x, int l, int r, int pos, int v)
{
	if(l == r)
	{
		tr[x] += v;
		return;
	}
	int mid = (l + r) >> 1;
	if(mid >= pos)	update(x * 2, l, mid, pos, v);
	else	update(x * 2 + 1, mid + 1, r, pos, v);
	tr[x] = max(tr[x * 2], tr[x * 2 + 1]);
}
int main()
{
	int n, m, q, x, y;
	scanf("%d%d%d", &n, &m, &q);
	for(int i = 1 ;i <= q; i++)
	{
		scanf("%d%d", &x, &y);
		bomb[x].push_back(y);
		cnt[y]++; 
	}
	build(1, 1, m);
	int ans = 0;
	for(int i = 1;i <= n; i++)
	{
		for(int j = 0; j < bomb[i].size(); j++)
			update(1, 1, m, bomb[i][j], -1);
		ans = max(ans, tr[1] + (int)bomb[i].size());
		for(int j = 0; j < bomb[i].size(); j++)
			update(1, 1, m, bomb[i][j], 1);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 25336
/*
 * Constraints
 * 1 ≤ |V| ≤ 100,000
 * 0 ≤ |E| ≤ 100,000
 * The graph is connected
 * There are no parallel edges
 * There are no self-loops
 */

#include <algorithm>
#include <iostream>
#include <set>
#include <stack>
#include <vector>

#define MAXM 100010
#define MAXN 100010

using namespace std;

struct {
  int to, next;
} E[4 * MAXM];

int LE[MAXN + MAXM];

pair<int, int> orig_edges[MAXM];

int main() {
  fill(LE, LE + MAXN + MAXM, -1);
  int n, m;
  cin >> n >> m;
  for (int src, dst, i = 0; i < m; i++) {
    cin >> src >> dst;
    // split each edge with an intermediate node
    E[4 * i] = {n + i, LE[src]};
    LE[src] = 4 * i;
    E[4 * i + 1] = {n + i, LE[dst]};
    LE[dst] = 4 * i + 1;
    E[4 * i + 2] = {src, LE[n + i]};
    LE[n + i] = 4 * i + 2;
    E[4 * i + 3] = {dst, LE[n + i]};
    LE[n + i] = 4 * i + 3;

    orig_edges[i] = {src, dst};
  }

  vector<int> cut_nodes;

  constexpr int big_n = MAXN + MAXM;
  int low[big_n]{0}, pre[big_n]{0}, parent[big_n]{0};
  fill(parent, parent + big_n, -1);
  int clk = 0;
  struct dfsdata {
    int id, parent;
    bool after;
  };
  stack<dfsdata> dfs;

  for (int i = 0; i < n + m; ++i) {
    if (pre[i])
      continue;
    dfs.push({i, -1, false});
    while (!dfs.empty()) {
      dfsdata d = dfs.top();
      dfs.pop();
      if (pre[d.id] && !d.after && d.parent != -1)
        low[d.parent] = min(low[d.parent], pre[d.id]);
      if (pre[d.id] && d.after && d.parent != -1)
        low[d.parent] = min(low[d.parent], low[d.id]);
      if (!pre[d.id]) {
        pre[d.id] = ++clk;
        low[d.id] = pre[d.id];
        parent[d.id] = d.parent;
        dfs.push({d.id, d.parent, true});
        for (int j = LE[d.id]; j != -1; j = E[j].next)
          dfs.push({E[j].to, d.id, false});
      }
    }
  }

  int n_children[big_n]{0};
  for (int i = 0; i < n + m; ++i)
    if (parent[i] != -1)
      ++n_children[parent[i]];

  for (int i = 0; i < n + m; ++i) {
    if (parent[i] == -1 && n_children[i] > 1)
      cut_nodes.push_back(i);
    if (parent[i] != -1 && parent[parent[i]] != -1 && low[i] >= pre[parent[i]])
      cut_nodes.push_back(parent[i]);
  }

  set<pair<int, int>> cut_edges;
  for (int u : cut_nodes) {
    if (u >= n) {
      int src = orig_edges[u - n].first;
      int dst = orig_edges[u - n].second;
      cut_edges.insert({min(src, dst), max(src, dst)});
    }
  }
  for (auto p : cut_edges) {
    cout << p.first << " " << p.second << endl;
  }
}


Measured memory_bytes: 9104
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<deque>
#include<queue>
using namespace std;
#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
typedef pair<int, int>P;
const int MOD = 1e9 + 7;
const int INF = 1e10;
const long double PI = (acos(-1));


signed main() {
	int N, K;
	cin >> N >> K;
	vector<int>x(N), right, left;
	rep(i, N) {
		cin >> x[i];
		if (x[i] > 0)right.push_back(x[i]);
		else if (x[i] < 0)left.push_back(-x[i]);
		else K--;
	}
	if (K <= 0) {
		cout << 0;
		return 0;
	}
	sort(right.begin(), right.end());
	sort(left.begin(), left.end());
	if (right.size() == 0) {
		cout << left[K - 1];
		return 0;
	}
	else if (left.size() == 0) {
		cout << right[K - 1];
		return 0;
	}
	int ans = INF;
	for (int i = 0; i < min(K, (int)right.size()); i++) {
		int l = K - i - 2;
		if (l >= left.size() || l < 0)continue;
		int sum = min(right[i] , left[l]) * 2 + max(right[i] , left[l]);
		ans = min(ans, sum);
	}
	cout << ans;
}

Measured memory_bytes: 2424
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;

public class Main {
	static int n;
	static int[][] scedule;
	
	public static void main(String[] args)
	{
		
		Scanner sca = new Scanner(System.in);
		
		scedule = new int[50][30];
		
		while(true)
		{
			n = sca.nextInt();
			if(n == 0) break;
			
			int i, j, k;
			for(i = 0;i < n;i++)
				for(j = 0;j < 30;j++)
					scedule[i][j] = 0;
			
			
			for(i = 0;i < n;i++)
			{
				int m = sca.nextInt();
				for(j = 0;j < m;j++) scedule[i][sca.nextInt() - 1] = 1;
			}
			
			ArrayList<HashSet<String>> having = new ArrayList<HashSet<String>>();
			for(i = 0;i < n;i++)
			{
				HashSet<String> tmp = new HashSet<String>();
				tmp.add(String.valueOf(i));
				having.add(tmp);
			}
			
			int result = -1;
			for(i = 0;i < 30;i++)
			{
				HashSet<String> canget = new HashSet<String>();
				
				for(j = 0;j < n;j++)
				{
					if(scedule[j][i] == 1)
					{
						HashSet<String> tmp = having.get(j);
						canget.addAll(tmp);
					}
				}
				
				if(canget.size() == n)
				{
					result = i + 1;
					break;
				}
				
				for(j = 0;j < n;j++)
				{
					if(scedule[j][i] == 1)
					{
						HashSet<String> tmp = having.get(j);
						tmp.addAll(canget);
					}
				}
			}
			
			System.out.println(result);
		}
	}
}

Measured memory_bytes: 101444
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

const int mod=1000000007;
ll modpow(ll x,ll n,ll mod){
    ll res=1;
    while(n>0){if(n&1) res=res*x%mod;x=x*x%mod;n>>=1;}
    return res;
}
int n;
ll a[10001];
map<ll,ll> mp;
void factor(int n){
    int tn=n;
    map<ll,ll> p;
    int cnt=0;
    for(ll i=2;i*i<=tn;++i){
        cnt=0;
        while(tn%i==0){
            ++cnt;
            tn/=i;
        }
        p[i]=cnt;
    }
    if(tn!=1) p[tn]=1;
    for(auto it:p){
        mp[it.first]=max(it.second,mp[it.first]);
    }
}
int main(){
    cin>>n;
    rep(i,n) cin>>a[i];
    ll lcm=1;
    rep(i,n)factor(a[i]);
    for(auto it:mp){
        lcm*=modpow(it.first,it.second,mod);
        lcm%=mod;
    }
    ll ans=0;
    rep(i,n){
        ans+=lcm*modpow(a[i],mod-2,mod);
        ans%=mod;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
using namespace std;
typedef long long llong;

int n, k;
llong T[100000];

int getShippableNumOfItems(llong P) {
    int i = 0;
    for (int j = 0; j < k; j++) {
        llong sum = 0;
        while (sum + T[i] <= P) {
            sum += T[i];
            i++;
            if (i == n) return n;
        }
    }
    return i;
}

int main() {
    cin >> n >> k;
    for (int i = 0; i < n; i++) cin >> T[i];

    llong left = 0;
    llong right = 100000 * 10000;
    llong mid;
    while (right - left > 1) {
        mid = (left + right) / 2;
        int v = getShippableNumOfItems(mid);
        if (v >= n) right = mid;
        else left = mid;
    }

    cout << right << endl;
}


Measured memory_bytes: 3884
#include<stdio.h>
#define N 200000
#define O 0
#define I 1

int main(){
  int i,n,Min,Max,R[N];

  scanf("%d",&n);
  for(i=O;i<n;i++){
    scanf("%d",&R[i]);
  }
  Min=R[O];
  Max=R[I]-R[O];

  for(i=I;i<n;i++){
    if(Max<R[i]-Min){
      Max=R[i]-Min;
    }
    if(Min>R[i]){
      Min=R[i];
    }
  }

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

  return O;
}



Measured memory_bytes: 2488
/* -------------------------------- Template -------------------------------- */

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <locale>
#include <iostream>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

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

template <typename T> T &chmin(T &a, const T &b) { return a = std::min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = std::max(a, b); }
template <typename T> int len(const T &x) { return x.size(); }

// template<typename T> constexpr T inf;
// template<> constexpr int inf<int> = 1e9;
// template<> constexpr ll inf<ll> = 1e18;
// template<> constexpr ld inf<ld> = 1e30;

struct yes_no : std::numpunct<char> {
  string_type do_truename()  const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};

void solve();

int main() {
  std::locale loc(std::locale(), new yes_no);
  std::cout << std::boolalpha << std::setprecision(12) << std::fixed;
  std::cout.imbue(loc);
  solve();
  return 0;
}

using namespace std;

/* -------------------------------- Library -------------------------------- */

/* ---------------------------------- Main ---------------------------------- */

void solve() {
  int A, B;
  string op;
  cin >> A >> op >> B;
  if (op == "+") cout << A + B << endl;
  else cout << A - B << endl;
  return;
}


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

int main() {
    // 入力
    int N, A;
    cin >> N >> A;

    // 処理
    int L = A;
    int R = A + N - 1;

    int eat;
    if (R <= 0)
        eat = R;
    else if (L >= 0)
        eat = L;
    else
        eat = 0;

    int answer = (R + L) * (R - L + 1) / 2 - eat;

    // 出力
    cout << answer << endl;

    return 0;
}


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define LIMIT 50

int n, m;
int a[LIMIT], b[LIMIT];
bool graph[LIMIT][LIMIT];
bool visited[LIMIT];

void dfs(int v) {
    visited[v] = true;
    rep(next, n) {
        if (graph[v][next] == false) continue;
        if (visited[next]) continue;
        dfs(next);
    }
}

int main(void) {
    cin >> n >> m;
    rep(i, m) {
        cin >> a[i] >> b[i];
        a[i]--, b[i]--;
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }

    int ans = 0;
    rep(i, m) {
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = false;
        rep(j, n) visited[j] = false;
        dfs(0);

        bool bridge = false;
        rep(j, n) if (visited[j]==false) bridge = true;
        if (bridge) ans++;

        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }
    cout << ans << endl;
}

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

#define REP(w, n) for(int w=0;w<int(n);++w)

int main() {
    int n, k, q; cin >> n >> k >> q;
    vector<int> a(q); REP(i, q) {
        int t; cin >> t;
        a[i] = t - 1;
    }

    vector<int> win(n, 0);
    REP(i, q) win[a[i]] += 1;

    REP(i, n) {
        if (k - (q - win[i]) > 0) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
	typedef long long ll;
	using namespace std;
	int main(){	
		ios_base::sync_with_stdio(false);
		    cin.tie(NULL);
		    map< string , int > mp;
		    mp["SUN"] = 0;
		    mp["MON"] = 1;
		    mp["TUE"] = 2;
		    mp["WED"] = 3;
		    mp["THU"] = 4;
		    mp["FRI"] = 5;
		    mp["SAT"] = 6;
		    string s;
		    cin >> s;
		    cout << 7 - mp[s] << endl;


	}

Measured memory_bytes: 256
#!/usr/bin/python3                                                                                                                                                                                          

import itertools

if __name__=='__main__':
    str = input()
    signs_comb = list(itertools.product([1, -1], repeat=3))
    for signs in signs_comb:
        sum = int(str[0])
        for i in range(3):
            sum += signs[i] * int(str[i + 1])
        if sum == 7:
            sign_char = ['+' if i==1 else '-' for i in signs]
            break
    exp = str[0] + sign_char[0] + str[1] + sign_char[1] + str[2] + sign_char[2] + str[3] + '=7'
    print(exp)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false);cin.tie(0);cout.precision(10);cout << fixed
#define endl '\n'

const ll MOD = 1e9 + 7;
struct mint {
    ll x;
    mint() : x(0) {}
    mint(ll x) : x((x % MOD + MOD) % MOD) {}
    mint& operator+=(const mint& r) { if ((x += r.x) >= MOD) { x -= MOD; } return *this; }
    mint& operator-=(const mint& r) { if ((x -= r.x) < 0) { x += MOD; } return *this; }
    mint& operator*=(const mint& r) { if ((x *= r.x) > MOD) { x %= MOD; } return *this; }
    mint& operator++() { if ((++x) >= MOD) { x -= MOD; } return *this; }
    mint operator++(int) { mint ret = x; if ((++x) >= MOD) { x-= MOD; } return ret; }
    mint& operator--() { if ((--x) < 0) { x += MOD; } return *this; }
    mint operator--(int) { mint ret = x; if ((--x) < 0) { x += MOD; } return ret; }
    mint operator+(const mint& r) { mint ret; return ret = x + r.x; }
    mint operator-(const mint& r) { mint ret; return ret = x - r.x; }
    mint operator*(const mint& r) { mint ret; return ret = x * r.x; }
    mint operator-() { return mint() - *this; }
    bool operator<(const mint& a) { return x < a.x; }
    bool operator>(const mint& a) { return x > a.x; }
    bool operator<=(const mint& a) { return x <= a.x; }
    bool operator>=(const mint& a) { return x >= a.x; }
    bool operator==(const mint& a) { return x == a.x; }
    bool operator!=(const mint& a) { return x != a.x; }
};
ostream& operator<<(ostream& os, const mint& r) { os << r.x; return os; }
ostream& operator>>(ostream& os, const mint& r) { os >> r.x; return os; }

void solve(istream& cin, ostream& cout) {
  int n, m;
  cin >> n >> m;
  if (n == m) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
}
#endif


Measured memory_bytes: 256
import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void calc(int[] a) {
    // x0 を求める(最初の山の雨量)
    int x0 = a.sum;
    for (int i = 1; i < a.length; i += 2) {
        x0 -= a[i] * 2;
    }

    // x0 が求まったので、残りは芋づる式に求める
    int[] xs = [x0];
    for (int i = 1; i < a.length; i++) {
        xs ~= 2 * a[i - 1] - xs[i - 1];
    }
    writeln(xs.map!(text).join(" "));
}

void main() {
    int n; scan(n);
    auto a = readints;
    calc(a);
}


Measured memory_bytes: 6424
n, k = map(int, input().split())
have = [False]*n

for _ in range(k):
    d = int(input())
    A = list(map(int, input().split()))
    for a in A:
        have[a-1] = True

ans = 0
for i in range(n):
    if have[i]==False:
        ans += 1

print(ans)

Measured memory_bytes: 9176
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  ll A,V,B,W,T;
  cin>>A>>V>>B>>W>>T;
  if((V-W)*T>=max(B-A,A-B)){cout<<"YES"<<endl;}
  else{cout<<"NO"<<endl;}
}


Measured memory_bytes: 3576
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <list>
#include <ctime>
#include <sstream>
#include <queue>
#include <stack>
#include <bitset>
#include <numeric>
#include <cassert>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
#define FOR(x, b, e) for(int x=(b); x<=(e); ++x)
#define FORD(x, b, e) for(int x=((int)(b))-1; x>=(e); --x)
#define REP(x, n) for(int x=0; x<(n); ++x)
#define ALL(c) c.begin(),c.end()
#define sz(x) ((int)((x).size()))
#define pb push_back
#define st first
#define nd second
#define mp(x,y) make_pair(x,y)
typedef short int sint;

#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 << ((it != d.b) ? ", " : "") << *it;
  }
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

const int mod = 1000000000 + 7;
const int nax = 202020;
ll sil[2 * nax];
ll res[nax];

ll pot(ll a, int b) {
  ll wyn = 1;
  while (b) {
    if (b&1) {
      wyn = (wyn * a) % mod;
    }
    a = (a * a) % mod;
    b >>= 1;
  }
  return wyn;
}

ll dwu(int n, int k) {
  ll r = sil[n];
  ll mian = (sil[k] * sil[n - k]) % mod;
  return (r * pot(mian, mod - 2)) % mod;
}

ll choose(int liczba, int pola) {
  // podziel liczba na pola, na kazdym ma byc conajmniej 1
  int nowaLiczba = liczba - pola;
  return dwu(nowaLiczba + pola - 1, pola - 1);
}

int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  sil[0] = 1;
  FOR(i, 1, 2 * n) {
    sil[i] = (sil[i - 1] * i) % mod;
  }
  k = min(k, n - 1);
  res[0] = 1;
  FOR(i, 1, k) {
    res[i] = res[i - 1];
    res[i] = (res[i] + choose(n, n - i) * dwu(n, i)) % mod;
  }
  cout << res[k] << endl;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define Ans(f, y, n) if(f) cout << y << endl; else cout << n << endl;
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i, v.size()){ cout << v[i] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

template<typename T> void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }

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

int mod = 1000000007;
//int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    int N; cin >> N;
    vec A(5); readv(A);
    int m = INF;
    REP(i, 5) Min(m, A[i]);
    int ans = 5;
    if(m < N) ans += (N - m - 1) / m + 1;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import sys
from bisect import bisect_left, bisect_right
from collections import deque




n = int(sys.stdin.readline())
L = [int(sys.stdin.readline()) for i in range(n)]
IS = deque([L[0]])
for i in range(1, n):
    if L[i] <= IS[0]:
        IS.appendleft(L[i])
    else:
        IS[bisect_left(IS, L[i]) - 1] = L[i]



print(len(IS))

Measured memory_bytes: 46556
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,d,x;
	cin >> n >> d >> x;
	int ans=x,a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
		ans += (d-1)/a[i]+1; 
	} 
	cout << ans;
	return 0; 
} 

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int n,even=0,odd=0;
    scanf("%d",&n);

    for(int i=1;i<=n;i++)
    {
        if(i%2==0)
            even++;
        if(i%2!=0)
            odd++;
    }
    printf("%d",even*odd);
}


Measured memory_bytes: 128
N = int(input())

def divisorChecker(N):
    cnt = 0
    for i in range(1,N +1):
        if N % i == 0:
            cnt += 1
    return cnt

output = 0
for i in range(1, N +1, 2):
    div_cnt = divisorChecker(i)
    if div_cnt == 8:
        output += 1
        
print(output)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define che
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define MP make_pair
#define PB push_back
#define fi first
#define se second
#define HALT {printf("NO\n"); exit(0);}
typedef long long LL;
typedef pair<int, int> PII;
const int N= 500 +10;


string s, tar="AKIHABARA";

bool dfs(string cur, int insa){
	if( insa==0) return cur==tar;
	bool flag= false;
	for (int i=0; i<=cur.size(); i++){
		string nx= cur;
		nx.replace(i,0,"A");
		flag |= dfs(nx, insa-1);
	}
	return flag;
}
int main(){

	cin>>s;
	int cnta=0;
	for (int i=0; i<s.size(); i++) cnta+= s[i]=='A';
	int insa=4-cnta;
	if ( insa<0) HALT;
	bool ok=dfs(s,insa);
	if ( ok) printf("YES\n");
		else printf("NO\n");
	return 0;
}

Measured memory_bytes: 256
def calc_next(arr):
	res = []
	for val in arr:
		for j in range(-1, 2):
			add = (val % 10) + j
			if add >= 0 and add <= 9:
				res.append(val * 10 + add)
	return res

k = int(input())
cur = []
A = []

for v in range(1, 10):
	cur.append(v)
	A.append(v)

for d in range(1, 10):
	cur = calc_next(cur)
	for val in cur:
		A.append(val)

print(A[k - 1])

Measured memory_bytes: 65008
import java.util.*;
public class Main{
    public static void main(String[] args){
	new Main().run();
    }

    Scanner kbd = new Scanner(System.in);

    void run(){
	while(kbd.hasNext()){
	    int n = kbd.nextInt();
	    if(n!=0) solve(n);
	}
    }

    void solve(int n){
	while(n>0){
	    int m = kbd.nextInt();
	    int e = kbd.nextInt();
	    int j = kbd.nextInt();
	    int rank = 0;
	    double ave3 = ave(m, e, j);
	    if(m==100 || e==100 || j==100)
		rank = 2;
	    else if(ave(m, e)>=90)
		rank = 2;
	    else if(ave3>=80)
		rank = 2;
	    else if(ave3>=70)
		rank = 1;
	    else if(ave3>=50 && (m>=80 || e>=80))
		rank = 1;

	    if(rank==2)
		System.out.println("A");
	    else if(rank==1)
		System.out.println("B");
	    else
		System.out.println("C");
	    n--;
	}
    }

    double ave(int m, int e){
	double a = (double)m;
	double b = (double)e;
	return (a+b)/2;
    }

    double ave(int m, int e, int j){
	double a = (double)m;
	double b = (double)e;
	double c = (double)j;
	return (a+b+j)/3;
    }
}

Measured memory_bytes: 28288
#include <iostream>
#include <string>
#include <string.h>
#include <cctype>

using namespace std;

int main() {
	char inputText[10];
	string inputText_s;
	cin >> inputText;
	inputText_s = inputText;

	string ans = "WA";
	int C_count = 0;
	int C_posi;
	bool komojika = true;

	if (inputText[0] == 'A') {
		for (int i = 2; i < (inputText_s.length() - 1); i++) {
			if (inputText[i] == 'C') {
				C_count++;
				C_posi = i;
			}
		}
		if (C_count == 1) {
			for (int i = 1; i < inputText_s.length(); i++) {
				if (i != C_posi) {
					if (isupper(inputText[i])) {
						komojika = false;
					}
				}
			}
			if (komojika == true) {
				ans = "AC";
		}

		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
"""
配列の一番左の値Xを基準に
それより小さい値と大きい値を分けて再配置するコード
Xより小さい値はiより左に、大きい値は右側に配置する。
jは現在探索している添字
"""


def partition(A, p, r):
    x = A[r]
    i = p - 1
    for j in range(p, r):
        # 小さい値があればそれより左に移動させる
        if A[j] <= x:
            # 添字iも大きくする
            i += 1
            A[i], A[j] = A[j], A[i]
    A[i + 1], A[r] = A[r], A[i + 1]
    return A, i + 1


# if __name__ == "__main__":
n = int(input())
A = list(map(int, input().split()))

A, I = partition(A, 0, n - 1)
# 標準出力に癖がある
# new_A=[]
# for i in range(n):
#     if i==I:
#         # new_A.append('[')
#         # new_A.append(str(A[i]))
#         # new_A.append(']')

#         print('[',end='')
#         print(A[i],end='')
#         print(']',end=' ')
#     else:
#         print(A[i],end=' ')
#         # new_A.append(str(A[i]))
# print()
# # print(' '.join(list(map(str, new_A))))

for i in range(n):
    if i:
        print(" ", end="")
    if i == I:
        print("[", end="")
    print(A[i], end="")
    if i == I:
        print("]", end="")
print()



Measured memory_bytes: 16392
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val
using namespace std;
using namespace __gnu_pbds;

#define sp << " " <<
#define mod 1000000007
#define PI 3.14159265358979323
#define y second
#define x first
#define pb push_back
#define mp make_pair
#define sz(a) a.size()
#define pqueue priority_queue< ll >
//#define pdqueue priority_queue< ll,vector<ll> ,greater< ll > >
#define codejamDebug(x) cout<<"Case #"<<x<<": ";
#define debug(x) cout<<"Case "<<x<<": "
#define rep(i,n) for(long long i=0;i<n;i++)
#define f(i,a,b) for(long long i = a; i < b; i++)
#define fd(i,a,b) for(long long i = a; i >=b; i--)
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef long long int           ll;
typedef long double             ld;
typedef unsigned long long int ull;
typedef vector <int>            vi;
typedef vector <ll>            vll;
typedef pair <int, int>        pii;
typedef pair <ll, ll>          pll;
typedef vector < pii >        vpii;
typedef vector < pll >        vpll;
typedef vector <string>         vs;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

//Handle:cyber_rajat

int main(int argc, char const *argv[])
{
	sync;
	/*#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif*/
	string s;
	cin>>s;
	ll len=s.size();
	bool flag=false;
	rep(i,len-1)
	{
		if(s[i]==s[i+1]){
			flag=true;
			break;
		}
	}
	if(flag)
		cout<<"Bad"<<endl;
	else
		cout<<"Good"<<endl;
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(S_A: str, S_B: str, S_C: str):
    S = [S_A, S_B, S_C]
    l = [len(S_A), len(S_B), len(S_C)]
    ith = [0, 0, 0]
    turn = 0

    while True:
        tt = ith[turn]
        if tt >= l[turn]:
            win = turn
            break
        k = ord(S[turn][tt])-ord('a')
        ith[turn] += 1
        turn = k
        # print(ith, turn)

    print("ABC"[win])
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S_A = next(tokens)  # type: str
    S_B = next(tokens)  # type: str
    S_C = next(tokens)  # type: str
    solve(S_A, S_B, S_C)


if __name__ == '__main__':
    main()


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

int main()
{
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
        A[i]--;
    }
    vector<int> B(N);
    for (int i = 0; i < N; i++)
    {
        cin >> B[i];
    }
    vector<int> C(N - 1);
    for (int i = 0; i < N - 1; i++)
    {
        cin >> C[i];
    }
    int ans = 0;
    for (int i = 0; i < N; i++)
    {
        ans += B[A[i]];
        if (0 < i && A[i] == A[i - 1] + 1)
        {
            ans += C[A[i - 1]];
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
	int l[10],v1,v2,i;
	double sure;
	
	while(0<=scanf("%d",&l[0])){
		for(i=1;i<10;i++){
			scanf(",%d",&l[i]);
			l[i]+=l[i-1];
		}
		scanf(",%d,%d",&v1,&v2);
		
		sure=(double)v1/(double)(v1+v2)*(double)(l[9]);
		
		for(i=0;i<10;i++){
			if(sure<=l[i]){
				printf("%d\n",i+1);
				break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <iomanip>

class Point
{
public:
    Point(): x(0), y(0) {}

    Point(int x, int y): x(x), y(y) {}

    int x, y;
};

double calcTriangle(const Point &first, const Point &second, const Point &third);

int cross(const Point &first, const Point &second);

double calcArea(Point *array, int start, int end);

int calcVectorCross(const Point &first, const Point &second, const Point &third);

int main()
{
    int dataNum = 0;
    while (1) {
        int pointNum;
        std::cin >> pointNum;

        if (pointNum == 0) {
            break;
        }

        dataNum++;

        Point *pointArray = new Point[pointNum];
        for(int i = 0; i < pointNum; i++) {
            int x, y;
            std::cin >> x >> y;
            pointArray[i] = Point(x, y);
        }

        std::cout << dataNum << " " << std::fixed << std::setprecision(1) << calcArea(pointArray, 0, pointNum - 1) << std::endl;
    }

    return 0;
}

int calcVectorCross(const Point &first, const Point &second, const Point &third)
{
    Point point1(second.x - first.x, second.y - first.y);
    Point point2(third.x - first.x, third.y - first.y);

    return cross(point1, point2);
}

double calcTriangle(const Point &first, const Point &second, const Point &third)
{
    return calcVectorCross(first, second, third) / 2.0;
}

int cross(const Point &first, const Point &second)
{
    return first.x * second.y - first.y * second.x;
}

double calcArea(Point *array, int start, int end)
{
    double area = 0;
    int first = start + 1;
    while(!(first == end)) {
        area += -calcTriangle(array[start], array[first], array[first + 1]);
        first++;
    }
    return area;
}

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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
  pr(b);
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

int main()
{
  int n;
  string s;
  cin >> n >> s;
  if (n % 2 != 0||n==1)
  {
    No();
    return 0;
  }
  else
  {
    rep(i, n / 2)
    {
      if (s[i] != s[n / 2 + i])
      {
        No();
        return 0;
      }
    }
  }
  Yes();
  return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
#define double long double
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define sp(p) cout<<setprecision(16)<<fixed<<p<<endl;
#define debug(x) cerr<<#x<<": "<<x<<endl;
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define rsort(a) sort(all(a),greater<>())
#define debg(a) cout<<#a<<" "<<a<<endl;
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
template<class T>inline int out(const T &t){ print(t); putchar('\n'); return 0; }
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> V;
const long long MOD=1000000007;
const long long INF = 1e18;
clock_t time_ini = clock();
double time_diff(){
  ll time_tmp = clock();
  const double time = static_cast<double>(time_tmp - time_ini) / CLOCKS_PER_SEC * 1000.0;
  return time;
}
#define saiaku if(time_diff() > 1990)
vector <ll> dp;


void solve(long long N){
  double ret=0;
  if(N%2){
    ret = ((N/2)+1)/(double)N;
  }else{
    ret = (N/2)/(double)N;
  }
  cout << ret << "\n";

}

int main(){
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define SZ(a) (int)((a).size())
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef double db;
typedef pair <int, int> Pii;
typedef pair <ll, int> Pli;
typedef unsigned long long ull;
const double eps = 1e-8;
const int mod = (int)(1e9) + 7;
const int inf = 0x7fffffff;
const int N = (int)(2e5) + 7;

int ls, lt;
char s[N], t[N];
int calc(int p) {
    int cnt = 0;
    for (int i = p, j = 1; i <= p + lt - 1; ++i, ++j) {
        if (s[i] != t[j]) ++cnt;
    }
    return cnt;
}

int main() {

    // freopen("in.in", "r", stdin);
    scanf("%s%s", s + 1, t + 1);
    ls = strlen(s + 1);
    lt = strlen(t + 1);
    int res = lt;
    for (int i = 1; i + lt - 1 <= ls; ++i) {
        res = min(res, calc(i));
    }
    printf("%d\n", res);

    return 0;
}

Measured memory_bytes: 3820
#include <iostream>
#include <bits/stdc++.h>
#include <iomanip>
#include<math.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
int  main(){
  ios_base::sync_with_stdio(0);
  	cin.tie(0);
  	cout.tie(0);
    int n;
    cin>>n;
    int m=n%10;
    if(m==3)
      cout<<"bon"<<endl;
    if(m==0||m==1||m==6||m==8)
      cout<<"pon"<<endl;
    if(m==2||m==4||m==5||m==7||m==9)
      cout<<"hon"<<endl;

    }


Measured memory_bytes: 3636
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
	boxes = []
	while True:
		h, w = [int(i) for i in input().split(" ")]
		if h == 0 and w == 0:
			break
		boxes.append([h, w])
	for i in boxes:
		for j in range(i[0]):
			print("#" * i[1])
		print()
	return
if __name__ == '__main__':
  main()

Measured memory_bytes: 7712
#include<cstdio>
#include<algorithm>
#include<cstdlib>
using namespace std;
int X,n,r[100010],Q,delta[100010],num0[100010],numx[100010],t[100010],a[100010];
int main()
{
	scanf("%d%d",&X,&n);
	for(int i=1;i<=n;i++)scanf("%d",&r[i]);
	scanf("%d",&Q);
	for(int i=1;i<=Q;i++)scanf("%d%d",&t[i],&a[i]);
	delta[0]=0;
	num0[0]=0;
	numx[0]=X;
	for(int i=1;i<=n;i++)
	{
		num0[i]=num0[i-1];
		numx[i]=numx[i-1];
		if(i&1)
		{
//			delta[i]=delta[i-1]-r[i]+r[i-1];
			num0[i]=max(num0[i],min(r[i]-r[i-1]-delta[i-1],numx[i]));
			delta[i]=max(delta[i-1]+num0[i-1]-r[i]+r[i-1],0)-num0[i];
		}
		else
		{
//			delta[i]=delta[i-1]+r[i]-r[i-1];
			numx[i]=min(numx[i],max(X-r[i]+r[i-1]-delta[i-1],num0[i]));
			delta[i]=min(delta[i-1]+numx[i-1]+r[i]-r[i-1],X)-numx[i];
		}
	}
	for(int i=1;i<=Q;i++)
	{
		int place=upper_bound(r+1,r+n+1,t[i])-r-1,ans=delta[place];
		if(a[i]<=num0[place])ans+=num0[place];
		else if(a[i]>=numx[place])ans+=numx[place];
		else ans+=a[i];
		if(place&1) ans=min(X,ans+t[i]-r[place]);
        else ans=max(0,ans-t[i]+r[place]);
        printf("%d\n",ans);
	}
	return 0;
}

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

int main() {
  
  int A;
  int B;
  int C;
  int D;
  cin >>A;
  cin >>B;
  cin >>C;
  cin >>D;
  int X;
 if(A%D==0){
   X=A/D;
 }
  else{
   X=(A/D)+1;
  }
  int Y;
  if(C%B==0){
   Y=C/B;
  }
  else{
   Y=(C/B)+1;
  }
  if(X<Y){
    cout << "No" << endl;
  }
  else{
    cout << "Yes" <<endl;
  }
}


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

// TYPEDEF
// ----------------------------------------
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pair;
typedef vector<ll> vll;
typedef vector<vector<ll>> Graph;
typedef vector<string> vs;
typedef vector<pair<ll, ll>> Pll;
typedef queue<ll> qll;

// REPEAT
// ----------------------------------------
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REPA(i,a) for(ll i=0;i<(ll)(a.size());i++);
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define COUT(a) cout << (a) << endl;
#define ENDL(a) cout << endl;
#define COUTA(i,a) for(ll i=0;i<(ll)(a.size());i++) {cout << (a)[i] << " ";} cout << endl;

// UTIL
// ----------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())

// DEBUG
// ----------------------------------------
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif

template <typename T>
void debugV(const vector<T> v) {
#ifdef _DEBUG
  rep(i, v.size()) {
    cout << i << ":" << v[i] << " ";
  }
  cout << endl;
#else
  (void)v;
#endif
}

// BIT FLAG
// ----------------------------------------
const unsigned int BIT_FLAG_0 = (1 << 0); // 0000 0000 0000 0001
const unsigned int BIT_FLAG_1 = (1 << 1); // 0000 0000 0000 0010
const unsigned int BIT_FLAG_2 = (1 << 2); // 0000 0000 0000 0100
const unsigned int BIT_FLAG_3 = (1 << 3); // 0000 0000 0000 1000
const unsigned int BIT_FLAG_4 = (1 << 4); // 0000 0000 0001 0000
const unsigned int BIT_FLAG_5 = (1 << 5); // 0000 0000 0010 0000
const unsigned int BIT_FLAG_6 = (1 << 6); // 0000 0000 0100 0000
const unsigned int BIT_FLAG_7 = (1 << 7); // 0000 0000 1000 0000
const unsigned int BIT_FLAG_8 = (1 << 8); // 0000 0001 0000 0000
const unsigned int BIT_FLAG_9 = (1 << 9); // 0000 0010 0000 0000
const unsigned int BIT_FLAG_10 = (1 << 10); // 0000 0100 0000 0000
const unsigned int BIT_FLAG_11 = (1 << 11); // 0000 1000 0000 0000

// CONST
// ----------------------------------------
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI=3.14159265358979323846; // or M_PI
constexpr int MOD = 1000000007;


void Main() {
  ll k, x;
  cin >> k >> x;

  FOR(i, -1000000, 1000000) {
    if (abs(i - x) < k) {
      COUT(i);
    }
  }


}

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

/*

3 2
*/


Measured memory_bytes: 3560