akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define REP(i,b,e) for(int i=(b);i<(e);++i)
#define RREP(i,b,e) for(int i=(b)-1;i>=e;--i)
#define rep(i,e) for(int i=0;i<(e);++i)

constexpr int MOD = 1000000007;
constexpr int INF = 1LL << 30;
constexpr long long LLINF = 1LL << 62;
constexpr double EPS = 1e-9;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15) << boolalpha;
  }
} initializer;

template<typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (T &x : vec) is >> x;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (auto it = vec.begin(); it != vec.end(); ++it) {
    if (it != vec.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}

template<typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &pa) {
  return os << "(" << pa.first << ", " << pa.second << ")";
}

template<typename Tuple, size_t N>
struct TuplePrinter {
  static void print(const Tuple &t) {
    TuplePrinter<Tuple, N-1>::print(t);
    cout << ", " << get<N-1>(t);
  }
};

template<typename Tuple>
struct TuplePrinter<Tuple, 1> {
  static void print(const Tuple &t) {
    cout << get<0>(t);
  }
};

template<typename... T>
ostream &operator<<(ostream &os, const tuple<T...> &tup) {
  os << "(";
  TuplePrinter<decltype(tup), sizeof...(T)>::print(tup);
  return os << ")";
}

template<typename T>
ostream &operator<<(ostream &os, const set<T> &se) {
  os << "{";
  for (auto it = se.begin(); it != se.end(); ++it) {
    if (it != se.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}

template<typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &ma) {
  os << "{";
  for (auto it = ma.begin(); it != ma.end(); ++it) {
    if (it != ma.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  return os << "}";
}

inline void print(void) { cout<<'\n'; }
template<class T> inline void print(const T &x) { cout<<x<<'\n'; }
template<class T, class... U> inline void print(const T &x, const U&... y) { cout<<x<<" "; print(y...); }
#define dump(...) cout<<#__VA_ARGS__<<": [L_"<<__LINE__<<"]"<<'\n'; print(__VA_ARGS__);cout<<'\n';

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


int main() {
  long long n, a, b; cin>>n>>a>>b;

  long long d = b - a;
  long long la = a-1, lb = b-1;
  long long ra = n-a, rb = n-b;

  long long ans = LLINF;
  if (d % 2 == 0) ans = min(ans, d / 2);
  ans = min(ans, la + d);
  ans = min(ans, rb + d);

  if (d % 2 == 1) {
    ans = min(ans, la + 1 + d / 2);
  }
  if (d % 2 == 1) {
    ans = min(ans, rb + 1 + d / 2);
  }
  print(ans);

  return 0;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
using ll=long long;
template<typename T=ll>inline T in(istream&is=cin){T ret;is>>ret;return ret;}
template<typename T>inline auto vec2(typename vector<T>::size_type h,typename vector<T>::size_type w,T v=T()){return vector<vector<T>>(h,vector<T>(w,v));}

int main()
{
    ll n=in(),r=in();
    cout<<r+max(100*(10-n),0ll)<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include <stdio.h>
#include <math.h>
#include <map>
#include <queue>
#include <string.h>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn = 1e12+9;
const int N=1e5+5;
ll a[N],x=1e18;
long long ans=1;
int main(){
    int n,f=0;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        if(!a[i]) f=1;
    }
    if(f) puts("0"),exit(0);
    for(int i=1;i<=n;i++){
        if(a[i]>(x/ans)){
            puts("-1");
            exit(0);
        }
        else ans*=a[i];
    }
    printf("%lld\n",ans);
    return 0;
}



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

int main() {
    int N;
    cin >> N;
    int A[N];
    rep(i, N) cin >> A[i];
    sort(A, A + N);
    bool div[A[N-1]+1] = {};
    int ans = 0;
    rep(i, N) {
        if (i != N - 1 && A[i] == A[i+1]) {
            div[A[i]] = true;
        }
        if (!div[A[i]]) {
            ans++;
        }
        for (int j = A[i]; j <= A[N-1]; j += A[i]) {
            div[j] = true;
        }
        
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 5312
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n,a[100005],b[100005];
int main(){
   scanf("%lld",&n);
   for(int i=1;i<=n;i++)
      scanf("%lld",&a[i]);
   sort(a+1,a+n+1);
   for(int i=1;i<=n;i++)
      b[i] = b[i-1] + a[i];
   int ans = 0;
   for(int i=n;i>=1;i--)
      if (2 * b[i] >= a[i+1]) ans++;
      else break;
   printf("%d",ans);
}


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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int x;
    cin >> x;
    string s;
    cin >> s;
    cout << (x >= 3200 ? s : "red");
    return 0;
}
    

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <algorithm>
#include <cmath>
#include <vector>
#include <regex> //正規表現
#include <map>
#include <set>
#include <cassert> //assart
#include <numeric>
#include <iterator>
#include <list>

using namespace std;
#define ll long long int
#define FOR(i,min,max) for(int i=(min);i<(max);i++)
#define FOReq(i,min,max) for(int i=(min);i<=(max);i++)
#define FORREV(i,max,min) for(int i=(max)-1;i>=(min);i--)
#define FORREVeq(i,max,min) for(int i=(max);i>=(min);i--)
const int  MOD=1e9+7;
const int  INF=2000000000;
const int INF2=  10000000;
const double  Micro=1e-5;

int UnUsedVariable(){
    if(INF || Micro || MOD || INF2){;}
    return 0;
}

#define pf printf
#define sf scanf
#define inarray(array,min,max) FOR(i,min,max){cin>>array[i];}
#define inarrayW(arrayA,arrayB,min,max) FOR(i,min,max){cin>>arrayA[i]>>arrayB[i];}
#define br printf("\n");
#define OutputAndReturn0(x) {cout<<(x)<<endl;return 0;}

#define issame(a,b,c,d) ((a)==(b) and (b)==(c) and (c)==(d))
#define isdiff3(a,b,c) ((a)!=(b) and (b)!=(c) and (c)!=(a))
#define isdiff4(a,b,c,d) ((a)!=(b) and (b)!=(c) and (c)!=(a) and (d)!=(a) and (d)!=(b) and (d)!=(c))
inline int isEven(int x){return x%2==0;}
inline int isOdd (int x){return x%2==1;}
inline ll  gcd(ll a,ll b){ if(b==0)return a;else return gcd(b,a%b);}//最大公約数 なお一方が0なら答えは他方になるので番兵は０で良い また、負の数もOK -4%3=-1となるため
inline ll  lcm(ll a,ll b){return a*b/gcd(a,b);}//MODやオーバーフローには注意！



//Eと名のつくのはデバッグ用！
int EintN(int array[],const int num){
    for(int i=0;i<num;i++){cerr<<array[i]<<" ";}
    br;
    return 0;
}
int EintNN(const int heighth,const int width,int array[heighth][width]){
    FOR(i, 0, heighth){
        FOR(k, 0, width){
            {cerr<<array[i][k]<<" ";}
        }
        br;
    }
    br;
    return 0;
}
int Eint(string str,const int num){
    cerr<<str<<" is "<<num<<" now."<<endl;
    return 0;
}


int AllElementChange0(int array[],const int num){
    for(int i=0;i<num;i++){array[i]=0;}
    return 0;
}


int test(){
    return 0;
}

int Ap(){
    int ans;ans=0;
    int a;
    cin>>a;
    
    OutputAndReturn0(a*a*3);
    return 0;
}

int Bp(){
    int ans;ans=0;
    OutputAndReturn0(ans);
    return 0;
}

int Cp(){
    int ans;ans=0;
    OutputAndReturn0(ans);
    return 0;
}

int Dp(){
    int ans;ans=0;
    OutputAndReturn0(ans);
    return 0;
}

signed main(){
    //test();
    Ap();
    //Bp();
    //Cp();
    //Dp();
    return 0;
}


Measured memory_bytes: 888
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

int V,E;

vector<int> G[10000];
vector<int> reverse_G[10000];
stack<int> S;

int topo_rank[10000];
bool check[10000];

void dfs(int node_id){
	check[node_id] = true;

	for(int i = 0; i < G[node_id].size(); i++){
		if(!check[G[node_id][i]])dfs(G[node_id][i]);
	}
	S.push(node_id);
}

void reverse_dfs(int node_id,int num){
	check[node_id] = true;
	topo_rank[node_id] = num;

	for(int i = 0; i < reverse_G[node_id].size(); i++){
		if(!check[reverse_G[node_id][i]])reverse_dfs(reverse_G[node_id][i],num);
	}
}


int main(){

	scanf("%d %d",&V,&E);

	for(int i = 0; i < V;i++)check[i] = false;

	int from,to;

	for(int loop = 0; loop < E; loop++){
		scanf("%d %d",&from,&to);
		G[from].push_back(to);
		reverse_G[to].push_back(from);
	}

	for(int i = 0; i < V;i++){
		if(!check[i])dfs(i);
	}

	int num = 0;

	for(int i = 0; i < V;i++)check[i] = false;

	while(!S.empty()){
		if(!check[S.top()])reverse_dfs(S.top(),num++);
		S.pop();
	}

	int Q,left,right;
	scanf("%d",&Q);

	for(int loop = 0; loop < Q; loop++){
		scanf("%d %d",&left,&right);
		if(topo_rank[left] == topo_rank[right]){
			printf("1\n");
		}else{
			printf("0\n");
		}
	}

	return 0;
}



Measured memory_bytes: 4852
a, b, m = map(int, input().split())
ali = list(map(int, input().split()))
bli = list(map(int, input().split()))
xyc = [[int(i) for i in input().split()] for i in range(m)]
li = [0] * (m + 1)
for i in range(m):
    li[i] = ali[xyc[i][0] - 1] + bli[xyc[i][1] - 1] - xyc[i][2]
li[m] = min(ali) + min(bli)
print(min(li))


Measured memory_bytes: 36196
#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <random>
#include <utility>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <stdlib.h>
#include <algorithm>
#include <vector>
 
using namespace std;
typedef long long ll;
 
 
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
vector<int> G[100005];
std::vector<P> tree[100010];
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
 
ll i,j,k;
ll n,m;
ll a[100005],b[100005];
ll ans=0;
ll c=0;
char s[200005];
bool flag=false;

int main(){
	cin>>s;
	n=strlen(s);
	for(i-0;i<n;i++){
		if(s[i]=='S'){
			c++;
		}else{
			if(c>0)ans++;
			c=max(0ll,c-1);
		}
	}
	cout<<n-2*ans<<endl;
	return 0;
}

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

int main()
{
    int a, b;

    cin >> a >> b;

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

    return 0;
}

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

int main(void){
  int N;
  cin >> N;
  vector<int> B(N - 1), A(N);
  int sum = 0;
  for(int i = 0; i < N - 1; i++){
    cin >> B[i];
  }
  A[0] = B[0];
  A[N - 1] = B[N - 2]; 
  for(int i = 1; i < N - 1; i++){
    if(B[i] > B[i - 1]) A[i] = B[i - 1];
    else A[i] = B[i];
  }
  for(int i = 0; i < N ; i++){
    //cout << A[i] << " ";
    sum += A[i];
  }

  cout << sum << endl;
  
  return 0; 
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
const int N = 1300;
int main()
{
	char str[N];
	while(fgets(str, 1300, stdin))
	{
		int sum = 0;
		if(str[0] == '0')
		{
			break;
		}
		for(int i = 0; i < strlen(str) - 1; i++)
		{
			sum += str[i] - '0'; 
		}
		printf("%d\n", sum);
	}
	return 0;
} 


Measured memory_bytes: 2688
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include <climits>
#include<fstream>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
typedef long long ll;
typedef long double ld;
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct E {//辺の情報を入れる変数
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(H a, H b) {
	return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}//rad＝座標上の2点間の距離
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x%p;
		x = x * x%p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++
int n, m;
int d[20000];
int p[20000];
H a[20000];
signed main() {
	while (cin >> n >> m && n + m > 0) {
		for (int i = 0; i < n; i++) {
			cin >> d[i] >> p[i];
			a[i] = H{ p[i],i };
		}
		sort(a, a + n);
		reverse(a, a + n);
		int ans = 0;
		for (int i = 0; i < n; i++) {
			int t = a[i].y;
			if (m >= d[t]) {
				m -= d[t];
			}
			else {
				ans += p[t] * (d[t] - m);
				m = 0;
			}
		}
		cout << ans << endl;
	}
}


Measured memory_bytes: 3364
import sys
input = sys.stdin.readline


def factorial_cor(n):
    fact = 1
    for integer in range(1, n + 1):
        if fact > 10 ** 9 + 7:
            fact %= 10 ** 9 + 7
        fact *= integer

    return fact


n = int(input())

ans = factorial_cor(n) % (10 ** 9 + 7)
print(ans)


Measured memory_bytes: 2940
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<deque>
#include<bitset>
#include<map>
#define inf 1e9
#define eps 1e-6
#define N 4010
#define mod 924844033
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
inline ll read()
{
	char ch=getchar();
	ll s=0,w=1;
	while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
	return s*w;
}
ll f[N][N][2];
int n,k;
int ed[N],tot;
ll fac[N];
int vis[N][2];
int main()
{
	n=read(),k=read();
	fac[0]=1;
	for(register int i=1;i<=n;i++)fac[i]=fac[i-1]*i%mod;
	for(register int i=1;i<=n;i++)
	{
		for(register int j=0;j<=1;j++)
		{
			if(!vis[i][j])
			{
				for(register int now=i,p=j;now<=n;now+=k,p^=1)++tot,vis[now][p]=1;
				ed[tot]=1;
			}
		}
	}
//	cout<<ed[tot]<<endl;
	f[1][0][0]=1;
	for(register int i=1;i<=tot;i++)
	{
		for(register int j=0;j<=n;j++)
		{
			f[i+1][j][0]=(f[i][j][0]+f[i][j][1])%mod;
			if(!ed[i])f[i+1][j+1][1]=f[i][j][0];
		}
	}
	ll ans=fac[n],c=-1;
	for(register int i=1;i<=n;i++)
	{
		ans=(ans+(f[tot][i][0]+f[tot][i][1])%mod*fac[n-i]%mod*c)%mod;
		c=-c;
	}
	printf("%lld\n",(ans+mod)%mod);
	return 0;
}


Measured memory_bytes: 249728
H, W = gets.split.map(&:to_i)
css = Array.new(10) { gets.split.map(&:to_i) }
Ass = Array.new(H) { gets.split.map(&:to_i) }

10.times do |k|
  10.times do |i|
    10.times do |j|
      css[i][j] = [css[i][j], css[i][k] + css[k][j]].min
    end
  end
end

ans = 0
H.times do |i|
  W.times do |j|
    next if Ass[i][j].negative?
    ans += css[Ass[i][j]][1]
  end
end

puts ans


Measured memory_bytes: 2556
#include <stdio.h>

int main()
{
  int K,N;
  scanf("%d %d",&K,&N);
  int min=K;
  int MinPla=0;
  int a[1000000],tmp,ans;
  
  for(int i=0;i<N;i++)
  {
    scanf("%d",&a[i]);
    if (i!=0)
    {
      tmp=K-a[i]+a[i-1];
      if(min > tmp)
      {
        min=tmp;
        MinPla=i;
      }
    }
  }
  tmp=a[N-1]-a[0];
  if(min > tmp)
    ans=tmp;
  else
    ans=min;
  printf("%d",ans);
}

Measured memory_bytes: 2816
package main

import (
    "fmt"
    "strings"
)

func main() {
    var s string
    fmt.Scan(&s)
    s = strings.Replace(s, "dream", "D", -1)
    s = strings.Replace(s, "erase", "E", -1)
    s = strings.Replace(s, "Der", "", -1)
    s = strings.Replace(s, "Er", "", -1)
    s = strings.Replace(s, "D", "", -1)
    s = strings.Replace(s, "E", "", -1)
    s = strings.TrimSpace(s)

    if s == "" {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

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

using namespace std;

int H, W;
int A[80+1][80+1], B[80 + 1][80 + 1];

bool dp[80][80][160 * 80 * 2 + 10];
const int geta = 80 * 80;

int main() {
	cin >> H >> W;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cin >> A[i][j];
		}
	}
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cin >> B[i][j];
		}
	}

	dp[0][0][geta + A[0][0] - B[0][0]] = true;
	dp[0][0][geta - B[0][0] + A[0][0]] = true;

	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (i == j && i == 0)continue;
			for (int num = 0; num <= 80 * 160; num++) {
				if (i > 0) {
					if (num - A[i][j] + B[i][j] >= 0 && num - A[i][j] + B[i][j] <= 80 * 160 && 
						(dp[i - 1][j][num - A[i][j] + B[i][j]]))
						dp[i][j][num] = true;
					if (num - B[i][j] + A[i][j] <= 80 * 160 && num - B[i][j] + A[i][j] >= 0 && 
						(dp[i - 1][j][num - B[i][j] + A[i][j]]))
						dp[i][j][num] = true;
				}
				if (j > 0) {
					if (num - A[i][j] + B[i][j] >= 0 && num - A[i][j] + B[i][j] <= 80 * 160 && 
						(dp[i][j - 1][num - A[i][j] + B[i][j]]))
						dp[i][j][num] = true;
					if (num - B[i][j] + A[i][j] <= 80 * 160 && num - B[i][j] + A[i][j] >= 0 && 
						(dp[i][j - 1][num - B[i][j] + A[i][j]]))
						dp[i][j][num] = true;
				}
			}
		}
	}
	int ans = 80 * 80;
	for (int i = 0; i <= 80 * 160; i++) {
		if (dp[H - 1][W - 1][i]) {
			ans = min(ans, abs(i - geta));
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 158976
import java.util.*;

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

	public void execute() {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		int[] march = new int[5];

		for (int i = 0; i < N; i++) {
			String si = sc.next();
			switch (si.charAt(0)) {
			case 'M':
				march[0]++;
				break;
			case 'A':
				march[1]++;
				break;
			case 'R':
				march[2]++;
				break;
			case 'C':
				march[3]++;
				break;
			case 'H':
				march[4]++;
				break;
			default:
			}
		}

		long patterns = 0;
		for (int i = 0; i < 5; i++) {
			for (int j = i + 1; j < 5; j++) {
				for (int k = j + 1; k < 5; k++) {
					patterns += (long)march[i] * march[j] * march[k];							
				}
			}
		}
		System.out.println(patterns);
		sc.close();
	}

}

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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int c[3][3];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> c[i][j];
    }
  }
  cout << (c[0][0] + c[1][2] + c[2][1] == c[0][1] + c[1][0] + c[2][2] && c[0][2] + c[1][1] + c[2][0] == c[0][1] + c[1][0] + c[2][2] ? "Yes\n" : "No\n");
  return 0;
}


Measured memory_bytes: 256
n, k, q = map(int, input().split())
a  = [int(input()) for i in range(q)]
t = [k]*n
t = [n-1*q for n in t]

for i in range(q):
    t[a[i]-1] +=1

for i in range(n):
    if t[i] >0:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 11820
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int ritsu = sc.nextInt();
		double ans = 0;
		ans = ritsu/2;
//		if(ritsu%2 != 0) {
//			ans = (ritsu/2);
//		} else {
//			ans = (ritsu/2);
//		}
		System.out.println(1- (ans/ritsu));
		//		// Scannerクラスのインスタンスをクローズ
				sc.close();
	}
}


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

ll f(vector<ll> &a, double x){
    int n = a.size();
    ll ret = 0LL;
    rep(i,n) ret += ll((a[i]*1.0)/x);
    return ret;
}

ll roundup(double x){
    if(ll(x) == x) return ll(x);
    return ll(x+1.0);
}

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

    int n; ll k; cin >> n >> k;
    vector<ll> a(n); rep(i,n) cin >> a[i];
    sort(a.begin(), a.end(), greater<ll>());

    long double left = 0, right = a[0], mid;
    
    while(abs(left - right) >= 1e-3){
        mid = (left + right)/2.0;
        if(f(a, mid) <= k) right = mid; // ok
        else left = mid; // false
    }

    cout << roundup(mid) << endl;
}

Measured memory_bytes: 4752
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))


n = int(input())
p = list(map(int, input().split()))

q = sorted(p)

ans = 0
for i in range(n):
    if p[i] != q[i]:
        ans += 1
if (ans <= 2):
    print("YES")
else:
    print("NO")


Measured memory_bytes: 9116
#include<iostream>
#include<cmath>
#include<cstdio>

struct Vector{
	double x, y;
};

Vector plus(Vector a, Vector b){
	return {a.x+b.x, a.y+b.y};
}

Vector times(Vector v, double c){
	return {c*v.x, c*v.y};
}

Vector getNormalVector(Vector v){
	return {-v.y, v.x};
}

double distance(Vector v){
	return sqrt(v.x*v.x+v.y*v.y);
}

int main(){
	Vector vs[1001];
	vs[2] = {1, 1};
	for(int i=3;i<1001;i++){
		Vector v = vs[i-1], nv = getNormalVector(v);
		nv = times(nv, 1.0/distance(nv));
		vs[i] = plus(v, nv);
	}
	
	int n;
	while(std::cin >> n, ~n){
		printf("%.2f\n%.2f\n", vs[n].x, vs[n].y);
	}
}

Measured memory_bytes: 1212
#include<bits/stdc++.h>
#define maxn 234567

using namespace std;
typedef long long ll;
const ll t=1000000000000000ll;
ll a[maxn],k,s[300],r,d,cnt;

int main(){
    for (int i=1;i<=8;i++) a[cnt++]=i;
    for (int i=1;i<300;i++) s[i]=s[i/10]+i%10; d=1;
    for (int i=1;i<=15;i++){
        d=d*10;
        for (int j=0;j<min(300ll,t/d);j++){
            if (j%10==9) continue;
            if (s[j]+i*9>j) a[cnt++]=d*(j+1)-1;
        }
    }
    sort(a,a+cnt);
    cin >> r;
    for (int i=0;i<r;i++) cout << a[i] << endl;
    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const int mod = 998244353;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll c(ll n, ll k) { ll a = 1; rep(i, 1, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }
ll dp[3001][3001];
int main(void) {
	int n, s;
	cin >> n >> s;
	vector<int> a(n);
	rep(i, 0, n)cin >> a[i];
	dp[0][0] = mpower(2, n);
	ll inv2 = mpower(2, mod - 2);
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j <= s; ++j) {
			dp[i + 1][j] += dp[i][j];
			dp[i + 1][j] %= mod;
			if (j >= a[i])dp[i + 1][j] += dp[i][j - a[i]] * mpower(2, mod - 2);
			dp[i + 1][j] %= mod;
		}
	}
	printf("%lld\n", dp[n][s]);
	return 0;
}

Measured memory_bytes: 73992
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int rate = sc.nextInt();
		if (rate < 1200) {
			System.out.println("ABC");
		} else {
			System.out.println("ARC");
		}
		sc.close();
	}
}

Measured memory_bytes: 21972
#!/usr/bin/env python3
import sys

sys.setrecursionlimit(10 ** 8)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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


def solve():
    minc = 1000
    for a in A:
        c = 0
        while (a & 1) == 0:
            a >>= 1
            c += 1
        minc = min(minc, c)
    return minc


if __name__ == "__main__":
    print(solve())


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

int a[4], x, y, ans;

int main(){
    for (int i = 1; i <= 3; i++) cin >> a[i];
    sort(a+1, a+4);
    ans = 0;
    if (a[1]%2 == 1 && a[2]%2 == 0 || a[1]%2 == 0 && a[2]%2 == 1){
        ans = 1;
        a[1]++;
        a[3]++;
    }
    if ((a[3] - a[1])%2 == 1 && (a[3] - a[2])%2 == 1)
        cout << ans + a[3] - a[2] + (a[2] - a[1])/2;
    else if ((a[3] - a[1])%2 == 0 && (a[3] - a[2])%2 == 0) 
        cout << ans +(a[3]-a[1])/2 + (a[3]-a[2])/2;
    else cout << ans + (a[2] - a[1])/2 + a[3] - a[2];
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.math.*;
public class  Main{

	public static void main(String[] args) {
		FastScanner I=new FastScanner();
		Output o=new Output();
		int n=I.nextInt();
		int[] arr=new int[n];
		long sum=0;
		for(int i=0;i<n;i++) {
			arr[i]=I.nextInt();
			sum+=arr[i];
		}
		long y=(int)Math.round((double)sum/n);
		long ans=0;
		for(int i=0;i<n;i++) {
			ans+=(arr[i]-y)*(arr[i]-y);
		}
		System.out.println(ans);
		

	}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());};
	}

	static class Output{
		PrintWriter w=new PrintWriter(System.out);
		void pln(int x) {w.println(x); w.flush();}
		void pln(long x) {w.println(x); w.flush();}
		void pln(String x) {w.println(x); w.flush();}
		void pln(char x) {w.println(x); w.flush();}
		void pln(StringBuilder x) {w.println(x); w.flush();}
		void p(int x) {w.print(x);w.flush();}
		void p(long x) {w.print(x);w.flush();}
		void p(String x) {w.print(x);w.flush();}
		void p(char x) {w.print(x);w.flush();}
		void p(StringBuilder x) {w.print(x);w.flush();}
	}
}


Measured memory_bytes: 32904
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iomanip>
using namespace std;
 
#define REP(i,n) for(long long (i)=0;(i)<(long long)(n);(i)++)
#define RREP(i,n) for(long long (i)=(long long)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;
 
int main() {
 
    string s; cin >> s;
    string st = s;
    
    REMOVE(s, 'x');

    REP(i,s.size() / 2) {
    	if (s[i] != s[s.size() - i - 1]) {
    		cout << -1 << endl;
    		return 0;
    	}
    }

    REP(i,st.size() / 2) {
    	if (st[i] != st[st.size() - i - 1]) {
    		goto nxt;
    	}
    }
    cout << 0 << endl;
    return 0;

    nxt:;

    vector < int > ss;
    int cnt = 0;
    REP(i,st.size()) {
    	if (st[i] == 'x') {
    		cnt++;
    		if (i == st.size() - 1) {
    			ss.push_back(cnt);
    		}
    	} else {
    		ss.push_back(cnt);
    		cnt = 0;
    		ss.push_back(-1);
    		if (i == st.size() - 1) {
    			ss.push_back(0);
    		}
    	}
    }


    int ans = 0;
    REP(i,ss.size() / 2) {
    	if (ss[i] >= 0) {
    		ans += abs(ss[i] - ss[ss.size() - i - 1]);
    	}
    }

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

Measured memory_bytes: 1656
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    for(int i = 0; i < n; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      int c = sc.nextInt();
      if(a*a == b*b+c*c || b*b == a*a+c*c || c*c == a*a+b*b) {
        System.out.println("YES");
      }
      else {
        System.out.println("NO");
      }
    }
  }
}

Measured memory_bytes: 12000
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
typedef pair<int, int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);



int main() {


    ll s;
    cin>>s;

    ll x1=0,y1=0;

    ll x2,y2,x3,y3;
    y2=1;
    x2=1000000000;




    x3=(x2-s%x2)%x2;


    y3 = (s+x3)/x2;
   // y3 = (s+x2)/x2-1;

//   if(s%x2==0){
//       x3 = 0;
//       y3 = s/x2;
//   }else{
//       y3 = s/x2+1;
//       x3 = x2*y3-s;
//   }



    cout<<x1<<" "<<y1<<" "<<x2<<" "<<y2<<" "<<x3<<" "<<y3<<endl;


    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.lang.StringBuilder
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val n = sc.nextInt()
    val k = sc.nextInt()
    val a = Array(n) { sc.nextInt() }
    val ind = (0 until n).filter { a[it] == 1 }.first()!!
    var ans = (ind + k - 2) / (k - 1)
    val ind2 = Math.min(n - 1, ans * (k - 1))
    ans += (n - ind2 + k - 3) / (k - 1)
    println(ans)
}

fun main(args: Array<String>) {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}


Measured memory_bytes: 43564
#include<bits/stdc++.h>
#define MaxN 100000+100
using namespace std;
int a[MaxN];
int my_max(int a,int b)
{
	return a>b ?a:b;
}
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		int num;
		scanf("%d",&num);
		a[num]++;
	}
	int q=0;
	for(int i=1;i<MaxN-1;i++)
	{
		q=my_max(q,a[i]+a[i-1]+a[i+1]);
	}
	printf("%d\n",q);
	return 0;
}

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

int main() {
  int N; string S;
  cin >> N >> S;
  int counter = 0;
  for (int i = 0; i < N - 2; i++) {
    if (S.substr(i, 3) == "ABC") counter++;
  }
  cout << counter << endl;
}

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

using namespace std;


int main() {
  int x;
  scanf("%d", &x);
  int ans = 1;
  for (int b = 2; b <= x; b++) {
    int y = b;
    for (int p = 0; y * b <= x; p++) {
      y *= b;
      ans = max(ans, y);
    }
  }
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 256
import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		final int
			TOTAL_CARDS = 52;					//カード総数
			
		final String[]
			MARK		= {"S","H","C","D"};	//絵柄
			
		//全種類のどのカードを所持しているかのフラグ
		boolean[] flagArray	= new boolean[TOTAL_CARDS];
		
		//所持カード枚数(入力レコード数)を記録
		int cardCount = Integer.parseInt(br.readLine());
		
		for(int i = 0;i < cardCount;i++){
			int arrayNum = 0;	//1~52の何番目か
			//所持カードの絵柄,数字の入力
			String[] input = br.readLine().split("[\\s]+");
			
			//絵柄と番号を1~52に対応させる
			for(int x = 0;x < MARK.length;x++){
				
				if(input[0].equals(MARK[x])){
					
					arrayNum = Integer.parseInt(input[1]) + (x * 13) - 1;
				}
			}
			//所持フラグの変更
			flagArray[arrayNum] = true;
		}
		
		//所持していなかったカードを表示させる
		for(int i = 0;i < flagArray.length;i++){
			
			if(flagArray[i] == false){
				
				//1~13までの数字に変換する
				//int cardNum = i % 13 + 1;
				
				//出力
				System.out.println(MARK[i / 13] + " " + String.valueOf(i % 13 + 1));
			}
		}
	}
}



Measured memory_bytes: 24592
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>

using namespace std;

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

    vector<int> s;
    long long high = 0, low = 0;
    long long rest = n;

    s.push_back(abs(n) % 2);
    rest = (rest - s[0]) / -2;

    for (int i = 1; rest != 0; i++) {
        int tmp = abs(rest) % 2;
        s.push_back(abs(rest) % 2);
        rest = (rest - s[i]) / -2;
    }

    for (int i = s.size() - 1; i >= 0; i--) {
        cout << s[i];
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;

#if DEBUG && !ONLINE_JUDGE
    ifstream input_from_file("input.txt");
    #define cin input_from_file
#else

#endif



int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); // Togliere nei problemi con query online

    int N, X, T;
    cin >> N >> X >> T;
    int Q = N/X;
    int res = Q*T;
    if (N-Q*X > 0) res += T;
    cout << res << "\n";
}


Measured memory_bytes: 3580
def prime_factorize(n):
    arr = []
    if n % 2 == 0:
        cnt = 0
        while n % 2 == 0:
            cnt += 1
            n //= 2
        arr.append([2, cnt])

    p = 3
    while p * p <= n:
        if n % p == 0:
            cnt = 0
            while n % p == 0:
                n //= p
                cnt += 1
            arr.append([p, cnt])
            p += 2
        else:
            p += 2
            continue

    if n != 1:
        arr.append([n, 1])

    return arr



n, p = map(int, input().split())

ans = 1

if p == 1:
    print(1)
    exit()

pr_list = prime_factorize(p)

for a, b in pr_list:
    if b >= n:
        ans *= a ** (b // n)

print(ans)


Measured memory_bytes: 9228
#include<stdio.h>

int main(){

  int n;
  int k=100;
  scanf("%d",&n);
  
  for(int i=0;i<3;i++){
    if(n/k==7){
      printf("Yes");
      return 0;
    }
    n=n-(n/k)*k;
    k=k/10;
  }
  
  printf("No");
  return 0;
}
         
      
    

Measured memory_bytes: 1728
#!/usr/bin/env python3
import sys
import decimal

def solve(H: int, W: int):
    decimal.getcontext().prec = 30
    if(H==1 or W==1):
        print(1)
        return
    if(H*W%2==0):
        print(decimal.Decimal(H*W/2))
    else:
        print(decimal.Decimal(H*W//2+1))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    solve(H, W)

if __name__ == '__main__':
    main()


Measured memory_bytes: 5332
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
use std::cmp::{min,max};
use std::collections::HashMap;
fn main() {
    input!{
        n:usize,
        an:[(i64,i64);n],
    }
    let mut ans = n as i64;
    if n == 1 {println!("1"); return;}
    for j in 0..n {
        for k in 0..j {
            let posi = (an[j].0 -an[k].0,an[j].1 - an[k].1);
            let mut cnt = 0;
            for &(x,y) in &an {
                if !an.contains(&(x-posi.0,y-posi.1)) {
                    cnt += 1;
                }
            }
            ans = min(ans,cnt);
        }
    }
    println!("{}",ans);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define pb push_back
#define pll pair<ll,ll>
ll INF = 1000000007;


/***************/
 #define amin main
/***************/

ll exp(ll x, ll n)
{if(n==0) return 1;if(n==1) return x%INF;if(n%2==0) return exp((x*x)%INF,n/2); else return(x*exp((x*x)%INF,n/2))%INF;}


int amin()
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll t,i,j;
	string a,b;
	cin>>a>>b;
	ll cnt =0;
	for(i=0;i<a.length();i++)
	{
		if(a[i]!=b[i])
			cnt++;
	}
	cout<<cnt<<endl;
	


	
	

	
	


	
	return 0;
}

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

using i64 = long long int;

const int INF = 1e9;

int dp[22][50003]={0};

int main(){
    int n, m;
    cin >> n >> m;
    vector<int> v;
    for(int i=0;i<m;++i){
        int c;
        cin >> c;
        v.push_back(c);
    }

    for(int i=0;i<=m;++i){
        for(int j=0;j<=n;++j)
            dp[i][j] = INF;
    }
    dp[0][0] = 0;
    for(int i=1;i<=m;++i){
        for(int j=0;j<=n;++j){
            dp[i][j] = min(dp[i][j], dp[i-1][j]);
            if(j+v[i-1] <= n)dp[i][j+v[i-1]] = min(dp[i][j+v[i-1]], dp[i][j]+1);
        }
    }

    cout << dp[m][n] << endl;

    return 0;
}



Measured memory_bytes: 7248
#include <bits/stdc++.h>
using namespace std;
// マクロ
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
// 型エイリアス
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;

int main() {
    int n;
    cin >> n;
    if(n%2 == 0) cout << (n/ 2.0) / n << endl;
    else cout << (n/ 2+ 1.0) / n << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include "algorithm"
#include "bits/stdc++.h"
using namespace std ;
#define ll long long
ll a,b;
int main(){
    cin>>a;
    a%=1000;
    a=1000-a;
    if(a==1000)
        a=0;
    cout<<a;
    return 0;
}

Measured memory_bytes: 3620
import heapq

import itertools

class Heapq:
    def __init__(self, arr, desc=False):
        if desc:
            arr = [-a for a in arr]
        self.sign = -1 if desc else 1
        self.hq = arr
        heapq.heapify(self.hq)

    def pop(self):
        return heapq.heappop(self.hq) * self.sign

    def push(self, a):
        heapq.heappush(self.hq, a * self.sign)

    def top(self):
        return self.hq[0] * self.sign

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
C.sort(reverse=True)

p = itertools.product(A, B)
A_B_list = [sum(v) for v in itertools.product(A, B)]
A_B_list.sort(reverse=True)
A_B_C_list = [sum(v) for v in itertools.product(A_B_list[:3000], C[:3000])]
A_B_C_list.sort(reverse=True)

for ans in A_B_C_list[:K]:
    print(ans)

Measured memory_bytes: 141144
import java.util.Scanner;


public class Main{

	class Node{
		Node p;
		int[] child;
		int id;
		Node(int id){
			this.id=id;
		}
		public void print() {
			// TODO Auto-generated method stub
			System.out.print("node "+this.id+": ");
			System.out.print("parent = "+((this.p==null)?-1:this.p.id)+", ");
			
			int d=0;
			Node p=this.p;
			while(p!=null){
				d++;
				p=p.p;
			}
			System.out.print("depth = "+d+", ");
			System.out.print((this.p==null?"root":(this.child.length!=0?"internal node":"leaf"))+", ");
			
			System.out.print("[");
			for(int i=0;i<this.child.length;i++)
				System.out.print(this.child[i]+(i!=this.child.length-1?", ":""));
			System.out.println("]");
			
		}
	}
	void run(){
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		Node[] nodes=new Node[n];
		for(int i=0;i<n;i++){
			nodes[i]=new Node(i);
		}
		for(int i=0;i<n;i++){
			int id=scan.nextInt();
			int k=scan.nextInt();
			nodes[id].child=new int[k];
			for(int j=0;j<k;j++){
				int c=scan.nextInt();
				nodes[id].child[j]=nodes[c].id;
				nodes[c].p=nodes[id];
			}
		}
		for(int i=0;i<n;i++)
			nodes[i].print();
	
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		new Main().run();
	}

}



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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define REV(x) reverse(ALL((x)))
#define ASC(x) sort(ALL((x)))
#define DESC(x) ASC((x)); REV((x))
#define pb push_back
#define eb emplace_back

int main()
{
    ll N, P;
    cin >> N >> P;
    vec C(2, 0);
    REP(i,0,N) {
        ll a;
        cin >> a;
        ++C[a%2];
    }

    ll ans;
    ll K = C[1];
    if(K == 0) {
        if(P == 0) {
            ans = 1;
            REP(i,0,N) ans *= 2;
        }
        else ans = 0;
    }
    else {
        mat nCr(K+1, vec(K+1, 0));
        nCr[0][0] = 1;
        nCr[1][0] = 1;
        nCr[1][1] = 1;
        REP(i,2,K+1) {
            nCr[i][0] = 1;
            REP(j,1,K+1) nCr[i][j] = nCr[i-1][j] + nCr[i-1][j-1];
        }
        ans = 0;
        if(P == 0) {
            REP(i,0,K/2+1) ans += nCr[K][i*2]; 
        }
        else {
            REP(i,1,(K+1)/2+1) ans += nCr[K][i*2-1]; 
        }
        REP(i,0,N-K) ans *= 2;
    }
    PR(ans);

    return 0;
}

/*



*/

Measured memory_bytes: 3552
#ifdef _DEBUG
#define _CRT_SECURE_NO_WARNINGS
#include "MyLib.h"
#else
#define main_C main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define MGN 8
#define LINF (LONG_MAX/2)
using namespace std;
typedef long long ll; typedef unsigned long long ull;
typedef vector<int> vi; typedef vector<vi> vvi;
typedef vector<ll> vl; typedef vector<vl> vvl;
typedef vector<double> vd; typedef vector<string> vs;
typedef pair<int, int> pii; typedef pair<ll, ll> pll;
typedef vector<bool> vb; typedef vector<vb> vvb;
template <typename T>
using keyVal = pair<string, T>;
template<typename T>
bool val_greater(const keyVal<T>& left, const keyVal<T>& right) {
    return left.second > right.second;
}
vs split(string str, char sep) {
    vs v; stringstream ss(str); string t;
    while (getline(ss, t, sep)) v.push_back(t);
    return v;}
vs re_search_g(string s, regex re) {
    vs ret; smatch mc; auto it = s.cbegin();
    while (regex_search(it, s.cend(), mc, re)) {
        ret.push_back(mc[0]);
        it += mc.position(0) + mc.length();}
    return ret;}
#endif

void init_global_C() {}

int main_C() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N, M; cin >> N >> M;
    ll A=1e9 + 7;

    ll ans = 0;
    ll d = abs(N - M);
    if (d==0) {
        ans = 2;
        FOR(i, 2, N + 1) {
            ans *= i;
            ans %= A;
        }
        FOR(i, 2, M + 1) {
            ans *= i;
            ans %= A;
        }
    } else if (d==1){
        ans = 1;
        FOR(i, 2, N + 1) {
            ans *= i;
            ans %= A;
        }
        FOR(i, 2, M + 1) {
            ans *= i;
            ans %= A;
        }
    } else {
        ans = 0;
    }

    cout << ans << endl;

    return 0;
}

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

# define ll long long
# define mod 1000000007
# define MAX 100005
# define PI 3.141592653589793238                                                                                  //shortcut keys

# define pb push_back
# define mp make_pair
# define all(x) x.begin(),x.end()
# define fr(i,a,b) for(int i=a;i<=b;i++)

# define decimal(k) fixed<<setprecision(k)
# define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);        //---------------------------------------------------------------
using namespace std;

int main()
{
	int n;cin>>n;
	ll d;cin>>d;
	int ans=0;
	fr(i,1,n){
		ll x,y;cin>>x>>y;
		if(x*x+y*y<=d*d)ans++;
	}
    cout<<ans<<"\n";
	return 0;
}



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

using namespace std ;

#define sz(v) (int)v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )
#define PI acos( -1.0 )
#define forn( t , v , be , n ) for( t v = be ; v < n ; v++ )
#define fore( x , j ) for( auto x : j )
#define se second
#define fr first
//#define c_b fflush(stdin);

const ll Long_max = numeric_limits < ll > :: max() ;
const int Int_max = numeric_limits < int > :: max() ;

void File_input( string pathIn ) {
    freopen( pathIn.c_str(), "r", stdin ) ;
}

void File_output( string pathOut ) {
    freopen( pathOut.c_str(), "w", stdout ) ;
}

int msg() {
    srand( time( 0 ) ) ;
    vector < string > st = {
        "Wish everyone high ratings!",
        "Good luck!",
        "Have fun!",
        "Please, read all the problems!",
        "Go Go fight!"
    } ;
    cerr << st[ rand() % sz( st ) ] ;
    return 0 ;
}

void FastInputOutput() {
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

int n ;
int a , b ;

int main() {
    cin >> n ;
    if( n == 1 ){
        cout << "Hello World\n" ;
    } else {
      cin >> a >> b ;
      cout << a + b ;
    }

    return 0 ;
}


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

int main(){
    using namespace std;
    unsigned long N;
    cin >> N;
    vector<pair<long, long>> t(N);
    for(auto& i : t)cin >> i.first >> i.second;
    vector<vector<long double>> g(N, vector<long double>(N));
    for(unsigned long i = 0; i < N; ++i)for(unsigned long j = 0; j < N; ++j)g[i][j] = sqrt(static_cast<long double>((t[i].first - t[j].first) * (t[i].first - t[j].first) + (t[i].second - t[j].second) * (t[i].second - t[j].second)));
    vector<unsigned long> id(N);
    iota(id.begin(), id.end(), 0UL);
    long double ans{0};
    do{
        for(unsigned long i = 1; i < N; ++i)ans += g[id[i - 1]][id[i]];
    }while(next_permutation(id.begin(), id.end()));
    vector<unsigned long> f{1, 1, 2, 6, 24, 120, 720, 5040, 40320};
    printf("%.12Lf\n", ans / f[N]);
    return 0;
}

Measured memory_bytes: 256