akhauriyash/Code-Regression huggingface dataset:
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main{
	public static Rope[] rope;
	public static int n;
	public static double EPS = 1e-8;
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		while(true){
			n = in.nextInt();
			if(n == 0) return;
			rope = new Rope[n];
			for(int i=0; i<n; i++){
				rope[i] = new Rope(in.nextInt(), in.nextInt(), in.nextInt());
			}
			System.out.println(binarySearch());
		}
	}
	
	public static double binarySearch(){
		double max = 300;
		double min = 1;
		double mid = 0;
		for(int i=0; i<100; i++){
			mid = (max+min)/2;
			if(check(mid)){
				min = mid;
			}else{
				max = mid;
			}
		}
		return mid;
	}
	
	public static boolean check(double h){
		for(int i=0; i<n; i++){
			if(!rope[i].setR(h)) return false;
		}
		Queue<Point> qu = new LinkedList<Point>();
		for(int i=0; i<n; i++){
			qu.add(new Point(rope[i].x, rope[i].y));
		}
		for(int i=0; i<n-1; i++){
			for(int j=i+1; j<n; j++){
				Point[] p = crossPoint(rope[i], rope[j]);
				qu.add(p[0]);
				qu.add(p[1]);
			}
		}
		out: while(!qu.isEmpty()){
			Point p = qu.poll();
			for(int i=0; i<n; i++){
				if(!cross(rope[i], p)) continue out;
			}
			return true;
		}
		return false;
	}
	
	public static Point[] crossPoint(Rope r1, Rope r2){
		double x1 = r2.x - r1.x;
		double y1 = r2.y - r1.y;
		double a = (x1*x1+y1*y1+r1.r*r1.r-r2.r*r2.r)/2.0;
		Point[] res = {
				new Point(culc(x1, y1, r1.r, a, true)+r1.x, culc(y1, x1, r1.r, a, false)+r1.y),
				new Point(culc(x1, y1, r1.r, a, false)+r1.x, culc(y1, x1, r1.r, a, true)+r1.y),
		};
		return res;
	}
	
	public static double culc(double x, double y, double r, double a, boolean sign){
		return (a*x + (sign?1:-1)*y*Math.sqrt((x*x+y*y)*r*r-a*a))/(x*x+y*y);
	}
	
	public static boolean cross(Rope rp, Point p){
		return dist2(rp.x, rp.y, p.x, p.y) <= rp.r*rp.r+EPS;
	}
	
	public static boolean cross(Rope r1, Rope r2){
		return dist2(r1.x, r1.y, r2.x, r2.y) <= (r1.r + r2.r)*(r1.r + r2.r);
	}
	
	public static double dist2(double x1, double y1, double x2, double y2){
		return (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
	}
}

class Point{
	double x, y;
	public Point(double x, double y){
		this.x = x;
		this.y = y;
	}
}

class Rope{
	int x, y, l;
	double r;
	public Rope(int x, int y, int l){
		this.x = x;
		this.y = y;
		this.l = l;
		r = 0;
	}
	
	public boolean setR(double h){
		if(h > l) return false;
		r =  Math.sqrt(l*l-h*h);
		return true;
	}
}

Measured memory_bytes: 89892
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n;
  vector<int> d(n);
  for(int i=0;i<n;i++)
    cin>>d.at(i);
  sort(d.begin(),d.end());
  cin>>m;
  vector<int> t(m);
  for(int i=0;i<m;i++)
    cin>>t.at(i);
  sort(t.begin(),t.end());
  int j=0;
  for(int i=0;i<m;i++){
    while(true){
      if(j<n){
        if(t.at(i)>d.at(j)){
          j++;
        }else if(t.at(i)==d.at(j)){
          j++;
          break;
        }else{
          cout<<"NO";
          return 0;
        }
      }else{
        cout<<"NO";
        return 0;
      }
    }
  }
  cout<<"YES";
}

Measured memory_bytes: 1920
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

int main (void) {

    int n;
        scanf("%d",&n);
        double x[101]={0},y[101]={0},d1=0,d2=0,d3=0,dinf= 0;
        for (int i = 0; i < n; i++)scanf("%lf",&x[i]);
        for (int i = 0; i < n; i++)scanf("%lf",&y[i]);

        for (int i = 0; i < n; i++){
            d1+=pow(abs(x[i]-y[i]),1);
        }d1=pow(d1,1);
        
        for (int i = 0; i < n; i++){
            d2+=pow(abs(x[i]-y[i]),2);
        }d2=pow(d2,1.0/2.0);
        for (int i = 0; i < n; i++){
            d3+=pow(abs(x[i]-y[i]),3);
        }d3=pow(d3,1.0/3.0);
        
        for (int i = 0; i < n; i++){
            if(dinf < (abs(x[i]-y[i]))) dinf = abs(x[i]-y[i]);
        }
        
        printf("%lf\n",d1);
        printf("%lf\n",d2);
        printf("%lf\n",d3);
        printf("%lf\n",dinf);

    return 0;
}


Measured memory_bytes: 2100
s=input()
s2 = ''.join([c + ' ' for c in s])
res = 0
for i in range(2**(len(s)-1)):
  t = list(s2)
  for j in range(len(s)-1):
    if (i >> j) & 1:
      t[2*j+1] = '+'
  res += eval(''.join([c for c in t if c!=' ']))
print(res)

Measured memory_bytes: 3060
H, W, M = map(int, input().split())

HL, WL = [0]*H, [0]*W
B = []

for _ in range(M):
  h, w = map(lambda x:int(x)-1, input().split())
  B.append((h, w))
  HL[h] += 1
  WL[w] += 1

HM, WM = max(HL), max(WL)
K = HL.count(HM) * WL.count(WM)

cnt = 0
for h, w in B:
  if HL[h] == HM and WL[w] == WM:
    cnt += 1

if K > cnt:
  print(HM+WM)
else:
  print(HM+WM-1)

Measured memory_bytes: 54156
N = int(input().strip())
A = [int(str) for str in input().strip().split()]

def gcd(a, b):
    while(b != 0):
        a, b = b, a % b
    return a

A = sorted(A)[::-1]

ans = A[0]
for i in range(N - 1):
    ans = min(ans, gcd(A[i], A[i + 1]))

print(ans)

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

using namespace std;

int a,b;

int check(int t){
	int i = t%10;
	t /= 10;
	int j = t%10;
	t /= 100;
	int h = t%10;
	t /= 10;
	int k = t;
	if(k == i && j == h) return 1;
	else return 0;
}

int main(){
	cin >> a >> b;
	int cnt = 0;
	for(int i = 10001; i <= 99999; i++){
		int num = i;
		if(num >= a && num <= b){
			if(check(num)) cnt++;
		}
	}
	cout << cnt;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)

int main(int argc, char const *argv[]) {
  int n;
  string s;
  cin >> n >> s;
  int count = 0;
  rep(i, n - 2) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
      count++;
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
struct Edge
{
	int to;
	int nxt;
}e[400005];
int n,m,edgenum,head[200005],pa[200005],m1[200005],m2[200005],dep[200005],cnt[200005],now[200005];
void add(int u,int v)
{
	e[++edgenum].to=v;
	e[edgenum].nxt=head[u];
	head[u]=edgenum;
}
void dfs1(int node)
{
	dep[node]=dep[pa[node]]+1;
	now[dep[node]]=node;
	cnt[now[dep[m1[node]]+(dep[m2[node]]>dep[m1[node]])]]++;
	for(int hd=head[node];hd;hd=e[hd].nxt)
	{
		int to=e[hd].to;
		if(to==pa[node])continue;
		pa[to]=node;
		m1[to]=m1[node],m2[to]=m2[node];
		if(to>m1[to])m2[to]=m1[to],m1[to]=to;
		else if(to>m2[to])m2[to]=to;
		dfs1(to);
	}
}
void dfs2(int node)
{
	for(int hd=head[node];hd;hd=e[hd].nxt)
	{
		int to=e[hd].to;
		if(to==pa[node])continue;
		cnt[to]+=cnt[node];
		dfs2(to);
	}
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<n;i++)
	{
		int u,v;
		scanf("%d%d",&u,&v);
		add(u,v);
		add(v,u);
	}
	m1[1]=m2[1]=1;
	dfs1(1);
	dfs2(1);
	for(int i=2;i<=n;i++)printf("%d ",cnt[i]-1);
	printf("\n");
	return 0;
}

Measured memory_bytes: 16384
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <b; i++)
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int,int> pi;
#define trace(x) cout<<#x<<"="<<x<<"\n";
#define llp 1000000007
#define mod 1000000007

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "(" << p.first << ", " << p.second << ")";
}

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

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

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
    os << "[";
    typename map< F , S >::const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << it -> first << " = " << it -> second ;
    }
    return os << "]";
}

#define deb(x) cerr << #x << " = " << x << endl;
int gcd(int a, int b){
    if(b==0)return a;
    else return gcd(b,a%b);
}

int32_t main(){
	ios::sync_with_stdio(false);
    int n;
    cin>>n;
    vi a(n);
    REP(i,0,n)cin>>a[i];
    vi l(n),r(n);
    l[0]=a[0];
    r[n-1]=a[n-1];
    for(int i=1;i<n;i++){
        l[i]=gcd(l[i-1],a[i]);
    }

    for(int i=n-2;i>=0;i--){
        r[i]=gcd(r[i+1],a[i]);
    }
    // deb(l);
    // deb(r);
    int ans=1;
    ans=max(ans,r[1]);
    ans=max(ans,l[n-2]);
    for(int i=1;i<(n-1);i++){
        ans=max(ans,gcd(l[i-1],r[i+1]));
    }
    cout<<ans<<"\n";



	return 0;
}

Measured memory_bytes: 2560
#ifndef LOCAL
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#else
#include <iostream>
#include <iomanip> 
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; }
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
#define fix(a) fixed << setprecision(a)
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'



void solve(){
  int a,b,c;
  cin >> a >> b >> c;
  int x;
  cin >> x;
  int ans = 0;
  forn(i, a+1){
    forn(j, b+1){
      forn(k, c+1){
        ans += (i * 500 + j * 100 + k * 50) == x;
      }
    }
  }
  cout << ans;
}

int main() {
  ios::sync_with_stdio(false);
  // cin.tie(0); cout.tie(0);
  int t = 1;
  // cin >> t;
  forn(i, t){
    solve();
  }
}

/* 

50 50 50 50 50 50 50 50 50 50 50
100 50 50 50 50 50 50 50 50 50
100 100 100 100 100 50
500 50

50

50 50

50 50 50
100 50





*/

Measured memory_bytes: 3512
import numpy as np

n,k = map(int,input().split())
a = list(map(int,input().split()))
a = np.array(a)
a.sort()
plus = a[a>0]
zero = np.count_nonzero(a==0)
minus = a[a<0]

low = -10**20
hi = 10**20

while hi-low > 1:
    # n*nのマスからave以下という条件を満たす個数をカウントするイメージ
    item = 0
    ave = (hi+low)//2

    # aveがプラスの時ゼロの分は条件を満たすため加算してやる
    if ave >= 0:
        item += zero*n

    # bisect結果*(serchしたいplus) <= ave　を変形
    # bisect結果 <= ave//(serchしたいplus)　になる
    item += a.searchsorted(ave//plus,side='right').sum()

    # マイナスの方も式変形のやり方は同じ
    # マイナスの方は結果がaveより大きいものを除外する
    item += n*len(minus)-a.searchsorted(-(-ave//minus),side='left').sum()

    # 最後に条件は満たしているものの、自分自身をかけているものを引いてやる
    item -= np.count_nonzero(a*a <= ave)
    
    # 二分探索部分組み合わせの際に(a,b),(b,a)の２通り足してるので割る
    if item//2 >= k:
        hi = ave
    else:
        low = ave

print(hi)

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

int walking(vector<vector<char> > &walk, int a, int b, int &count){
	walk[a][b] = '#';
	
	if(walk[a-1][b] == '.'){
		count++;
		walking(walk, a-1, b, count);
	}

	if(walk[a][b-1] == '.'){
		count++;
		walking(walk, a, b-1, count);
	}

	if(walk[a+1][b] == '.'){
		count++;
		walking(walk, a+1, b, count);
	}

	if(walk[a][b+1] == '.'){
		count++;
		walking(walk, a, b+1, count);
	}

	return count;
}

int main(){
	while(1){
		int W, H, a=0, b=0, count=0;
		string str;
		vector<vector<char> > walk;

		cin>>W>>H;
		if((W == 0) && (H == 0))
			break;

		walk.resize(H+2);
		for(int i=0;i<H+2;i++){
			walk[i].resize(W+2);

			if((i == 0) || (i == H+1)){
				for(int j=0;j<W+2;j++)
					walk[i][j] = '#';
			}else{
				walk[i][0] = '#';
				walk[i][W+1] = '#';
			}
		}

		for(int i=1;i<=H;i++){
			cin>>str;
			
			for(int j=0;j<W;j++)
				walk[i][j+1] = str[j];
		}
		
		for(int i=1;i<=H;i++){
			for(int j=1;j<=W;j++){
				if(walk[i][j] == '@'){
					a = i;
					b = j;
					count++;
				}
			}
		}
		
		cout<<walking(walk, a, b, count)<<endl;
	}

	return 0;
}

Measured memory_bytes: 1244
def resolv
	n = gets.chomp.to_i
	sum = 0.0
	i = 0
    m = gets.split.map(&:to_i)
	for num in m
  		sum = sum + 1.0 / num
  		i = i + 1
	end
	puts(1.0 / sum)
end

resolv

Measured memory_bytes: 1788
#include<bits/stdc++.h>
#include<iostream>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=1e9+7;
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;cin>>n>>m;
    vector<ll>a(n+1);
    vector<ll>b(n);
    rep(i,n){
        cin>>a[i+1];
        b[i]=a[i+1];
    }
    a[0]=inf;
    sort(rall(a));
    sort(all(b));
    a[0]=0;
    REP(i,1,n+1){
        a[i]+=a[i-1];
    }
    ll l=0,r=inf*inf;
    ll ans=0;
    while(r-l>1){
        ll mid=(r+l)/2;
        ll cnt=0;
        rep(i,n){
            auto itr=lower_bound(all(b),mid-b[i]);
            cnt+=b.end()-itr;
        }
        if(cnt>=m){
            l=mid;
        }
        else r=mid;
    }
    //cout<<l<<endl;
    ll cnt=0;
    rep(i,n){
        auto itr=lower_bound(all(b),l-b[i]);
        //cout<<i<<' '<<b.end()-itr<<endl;
        ans+=a[b.end()-itr]+b[i]*(b.end()-itr);
        cnt+=b.end()-itr;
    }
    //cout<<cnt<<endl;
    ans-=(cnt-m)*l;
    cout<<ans<<endl;
}

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

using namespace std;

const int maxn=5e2+5;
typedef long long ll;

int dis[maxn][maxn];

char mp[maxn][maxn];

int num[maxn][maxn];

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

int main(){
	memset(dis,0x3f,sizeof(dis));
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%s",mp[i]+1);
	}
	int cnt=1;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(mp[i][j]=='.')
				num[i][j]=cnt++; 
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(mp[i][j]=='.'){
				for(int k=0;k<4;k++){
					int xx=i+dx[k];int yy=j+dy[k];
					if(mp[xx][yy]=='.'){
						dis[num[i][j]][num[xx][yy]]=1;
					}
				}
			}
		}
	}
	
	for(int k=1;k<cnt;k++){
		for(int i=1;i<cnt;i++){
			for(int j=1;j<cnt;j++){
				if(dis[i][j]>dis[i][k]+dis[k][j]){
					dis[i][j]=dis[i][k]+dis[k][j];
				}
			}
		}
	}
	int ans=0;
	for(int i=1;i<cnt;i++){
		for(int j=1;j<cnt;j++){
			if(i!=j)
				ans=max(ans,dis[i][j]);
		}
	}
	printf("%d",ans);
	return 0;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
const int maxn=200020,K=30;
#define MP make_pair
#define PB push_back
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define MEM(x,v) memset(x,v,sizeof(x))
inline ll read(){
	char ch=getchar();ll x=0,f=0;
	while(ch<'0' || ch>'9') f|=ch=='-',ch=getchar();
	while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
	return f?-x:x;
}
struct item{
	int a,b;
	bool operator<(const item &it)const{
		ll s1=1ll*(1-a)*it.b,s2=1ll*(1-it.a)*b;
		if(s1!=s2) return s1<s2;
		return b<it.b;
	}
}it[maxn];
int n,t,a[maxn],b[maxn],pos,ans,arr[maxn];
ll f[maxn][31];
int main(){
	n=read();t=read();
	FOR(i,1,n){
		it[i].a=read()+1;
		it[i].b=read()+it[i].a;
	}
	sort(it+1,it+n+1);
	FOR(i,1,n) a[i]=it[i].a,b[i]=it[i].b;
	FOR(i,0,n) FOR(j,0,K) f[i][j]=5e18;
	f[0][0]=0;
	ROF(i,n,0) if(a[i]!=1){pos=i+1;break;}
	arr[0]=0;
	FOR(i,1,n-pos+1) arr[i]=arr[i-1]+b[pos+i-1];
	FOR(i,1,pos-1) FOR(j,0,K){
		f[i][j]=f[i-1][j];
		if(j){
			ll s=f[i-1][j-1]*a[i]+b[i];
			if((s-b[i])/a[i]==f[i-1][j-1]) f[i][j]=min(f[i][j],s);
		}
	}
	FOR(i,0,K) FOR(j,0,n-pos+1) if((ull)f[pos-1][i]+arr[j]<=(ull)t) ans=max(ans,i+j);
	printf("%d\n",ans);
}

Measured memory_bytes: 52608
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;


fn main() {
    let n:usize = read();
    let x:i32 = read();
    let mut m:Vec<i32> = (0..n).map(|_| read()).collect();
    m.sort();

    println!("{}", n as i32 + (x - m.iter().sum::<i32>())/m[0]);


}


Measured memory_bytes: 4352
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

class union_find {
private:
	vector<int> uf;

	int find(int x) {
		return uf[x] < 0 ? x : uf[x] = find(uf[x]);
	}

public:
	explicit union_find(int n):uf(n, -1) {}

	void unite(int x, int y) {
		x = find(x);
		y = find(y);

		if(x == y) return;

		if(uf[x] > uf[y]) swap(x, y);

		uf[x] += uf[y];
		uf[y] = x;
	}

	int number_of_sets() const {
		return count_if(begin(uf), end(uf), [](int x) { return x < 0; });
	}
};

constexpr long long mod = 1000000007;

long long mod_pow(long long n, long long k) {
	long long res = 1;

	while(k > 0) {
		if(k & 1) res = (res * n) % mod;
		n = (n * n) % mod;
		k >>= 1;
	}

	return res;
}

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

	for(int n, m; cin >> n >> m && n;) {
		union_find uf(n);

		for(int i = 0; i < m; ++i) {
			int a, b;
			cin >> a >> b;
			uf.unite(a - 1, b - 1);
		}

		const int S = uf.number_of_sets();
		const auto ans = mod_pow(2, S);

		cout << (n == S ? ans : (ans + 1) % mod) << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1592
import java.io.*;

class Main {
	public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			String[] nums = kb.readLine().split( " " );
			
			Double x12 = Double.parseDouble( nums[0] ) - Double.parseDouble( nums[2] );
			Double y12 = Double.parseDouble( nums[1] ) - Double.parseDouble( nums[3] );
			
			System.out.println( Math.sqrt( x12*x12 + y12*y12 ) );
			
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
}

Measured memory_bytes: 17060
import java.util.*

fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val list = readLine()!!.split(" ").map { it.toDouble() }
  val sortedList = list.sortedBy { it }.reduce { a, b ->
    (a + b) / 2
  }
  println(sortedList)
}


Measured memory_bytes: 36076
#include<stdio.h>
int s[105];
int main()
{
	int a,b,n,i,j,c=0,m;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&s[i]);
		a=s[i]-1;
		c=c+a*a;
		
	}
	for(j=2;j<=100;j++)
	{
		m=0;
		for(i=0;i<n;i++)
		{
		a=s[i]-j;
		m=m+a*a;	
		}
		if(m<c)
		{
		c=m;
		b=j;
		}	
	}
	printf("%d",c);	
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int w,a,b;
    cin>>w>>a>>b;
    int x=a+w,y=b+w;
    if(x<b)
        cout<<b-x<<endl;
   else if((b>=a && b<=x) || (y>=a && y<=x) ||
           (a>=b && a<=y) || (x>=b && x<=y))
        cout<<"0"<<endl;
else
   cout<<a-y<<endl;


    return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define ll long long
#define inf 1010000000
#define infll 1010000000000000000ll
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define mpr make_pair
#define fi first
#define se second
#define pq priority_queue<int>
#define pqll priority_queue<ll>
#define up(x,y) (x<(y)?x=(y):0)
#define dn(x,y) (x>(y)?x=(y):0)
#define ad(x,y) (x=(x+(y))%mod)
#define ll long long
#define N 10009
#define mod 998244353
using namespace std;

int n,m,ans,fac[N],ifac[N];

int inv(int x){return x==1?1:(ll)(mod-mod/x)*inv(mod%x)%mod;}
ll C(int x,int y){
	return x<y||y<0?0:(ll)fac[x]*ifac[y]%mod*ifac[x-y]%mod;
}

int main(){
	scanf("%d%d",&n,&m);
	fac[0]=1;
	for (int i=1; i<=n; i++) fac[i]=(ll)fac[i-1]*i%mod;
	ifac[n]=inv(fac[n]);
	for (int i=n-1; ~i; --i) ifac[i]=(ll)ifac[i+1]*(i+1)%mod;
	for (int i=0; i<=n; i++){
		int tmp=0;
		for (int j=0; j<=m-1 && j<=i; j++)
			if (j*2>=m-1){
				int k=i-j;
				if (i>=k){
					ll t=j-k,w=m-1-j-k;
					if (t<0){
						if (j*2==m-1) ad(tmp,1);
					}
					else ad(tmp,C(t,w));
				}
			}
		for (int j=0;j<m-1;++j) ad(tmp,C(i,j-i));
		ad(ans,(ll)tmp*C(n,i));
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pi pair<ll,ll>
int main(){
    ll n,i,j;
    char ch;
    cin>>ch;
    if(ch>=65&&ch<=96){
        cout<<"A\n";
    }else{
        cout<<"a\n";
    }

}


Measured memory_bytes: 3620
a=input()
if a=="SUN":
    print(7)
elif a=="MON":
    print(6)
elif a=="TUE":
    print(5)
elif a=="WED":
    print(4)
elif a=="THU":
    print(3)
elif a=="FRI":
    print(2)
elif a=="SAT":
    print(1)
    

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define int int64_t
#define rep(i, N) for(int i=0; i<N; i++)
using namespace std;
using pair = pair<int, int>;
using tup  = tuple<int, int, int>;
using vec  = vector<int>;
using vvec = vector<vec>;

// プロトタイプ宣言
// int myfunc(int, vvec);

// グローバル変数
// int N, M;
// vvec data(N, vec(M));

// 関数：
int fct(int m, int k) {
	int ft = 1;
	rep(i, k) ft *= m;
	return(ft);
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int N, K; cin >> N >> K;
	vec h(N);
	rep(i, N) cin >> h.at(i);

	int ct = 0;
	rep(i, N) {
		if(h.at(i) >= K) ct += 1;
	}

	cout << ct << endl;
	return 0;
}
// std::string str;
// str = std::to_string(int i);
// bitset<3> s(N);


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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

ll N, K;
ll X[MAX_N] = {};
vector<ll> Left, Right;

signed main()
{
    cin >> N >> K;
    bool isZero = false;
    REP(i, N) {
        cin >> X[i];
        if(X[i] == 0) { isZero = true; }
        else if(X[i] < 0) { Left.push_back(abs(X[i])); }
        else { Right.push_back(X[i]); }
    }
    SORT(Left);
    ll ans = LLINF;
    // 左に寄ってから、右に行く
    REP(i, Left.size()) {
        ll cand = Left[i];
        ll cnt = i + 1;
        if(isZero) { cnt++; }
        if(cnt >= K) {
            ans = min(ans, cand);
            continue;
        }
        ll remain = K - cnt;
        if(remain > 0 && remain <= Right.size()) {
            cand += Left[i] + Right[remain - 1];
            ans = min(ans, cand);
        }
    }
    // 右に寄ってから、左に行く
    REP(i, Right.size()) {
        ll cand = Right[i];
        ll cnt = i + 1;
        if(isZero) { cnt++; }
        if(cnt >= K) {
            ans = min(ans, cand);
            continue;
        }
        ll remain = K - cnt;
        if(remain > 0 && remain <= Left.size()) {
            cand += Right[i] + Left[remain - 1];
            ans = min(ans, cand);
        }
    }
    if(K == 1 && isZero) { ans = 0; }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 2424
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)

using namespace std;
 
typedef long long int ll;

const ll INF=(ll)1e18;

int main(){
  int N;
  cin >> N;
  vector<int> x(N),y(N);
  REP(i,N){
    cin >> x[i] >> y[i];
  }
  double t = 0;
  REP(i,N){
    FOR(j,i+1,N){
//      cout << i << " " << j << endl;
      t += sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
    }
  }
  t = t * 2 / N;
  printf("%9f\n", t);
}

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

int main(){

  long long n;
  cin >> n;

  
  unordered_map<string,int> mp;
  for(int i=0;i<n;i++){
  string s;
  
cin >>s;
    sort(s.begin(),s.end());
    
    mp[s]++;
  }
  
  

long long  count=0;
  for(auto p : mp){
  long long c=p.second;
    count+= c*(c-1)/2;
  
  }
  
  cout << count << endl;



}


Measured memory_bytes: 10660
S = input()
t = [0] * (2 ** (len(S) - 1))
t[0] = int(S)
for i in range(2 ** (len(S) - 1)):
  r = 0
  s = ""
  l = list(bin(i)[2:])
  l = [0] * (len(S) - len(l) - 1) + l
  #print(l)
  for j in range(len(S)):
    if j == len(S) - 1:
      s += S[j]
      break
    if l[j] == "1":
      r += int(s + S[j])
      s = ""
    else:
      s += S[j]
  if s != "": r += int(s)
  #print(r)
  t[i] = r
print(sum(t))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 1e9 + 7;
const int maxn = 2000005;

void solve() {
    ll n;
    cin >> n;
    ll ans = 0;
    f1(n) {
        ans += i * (n + 1 - i);
    }
    f(n - 1) {
        int x, y;
        cin >> x >> y;
        ans -= (n + 1 - max(x,y)) * (min(x,y)); 
    }
    cout << ans << '\n';
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int c = 0;
    int t;
    if (!c) {
        t = 1;
    }
    else {
        cin >> t;
    }
    while (t--) {
        solve();
    }
}

Measured memory_bytes: 3660
#include <algorithm>
#include <cstdio>
#include <vector>
#include <setjmp.h>
using namespace std;
#define REDIRECT(x) freopen(x".in", "r", stdin), freopen(x".out", "w", stdout)
#define CLOSEALL() fclose(stdin), fclose(stdout)
#define eprintf(...) fprintf(stderr, ##__VA_ARGS__)

typedef long long i64;
const i64 MOD = 1e9 + 7;
const int MAXN = 3000 + 10;

int N, M;
i64 dp[MAXN][MAXN][2];

int main()
{
	//REDIRECT("piling");

	scanf("%d%d", &N, &M);

	dp[0][0][1] = 1;
	for(int i = 1; i <= N; i++)
		dp[0][i][0] = 1;

	for (int i = 0; i < M; i++)
		for(int j = 0; j <= N; j++)			// How many red blocks?
			for(int k = 0; k < 2; k++)
			{
				const int flag = (k | (j == 1));
				if(j > 0)
					dp[i+1][j-1][flag] = (dp[i+1][j-1][flag] + dp[i][j][k]) % MOD,
					dp[i+1][j][flag] = (dp[i+1][j][flag] + dp[i][j][k]) % MOD;
				if(j < N)
					dp[i+1][j][k] = (dp[i+1][j][k] + dp[i][j][k]) % MOD,
					dp[i+1][j+1][k] = (dp[i+1][j+1][k] + dp[i][j][k]) % MOD;
			}

//	for(int i = 0; i <= M; i++)
//	{
//		for(int j = 0; j <= N; j++)
//			eprintf("(%d, %d)", dp[i][j][0], dp[i][j][1]);
//		eprintf("\n");
//	}


	i64 answer = 0;
	for(int i = 0; i <= N; i++)
		answer = (answer + dp[M][i][1]) % MOD;

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

	return 0;
}


Measured memory_bytes: 141440
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 1'000'000'007;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, M; cin >> N >> M;
	map<int, int> mp;
	vector<int> a(N); rep(i, 0, N) {
		cin >> a[i];
	}
	vector<int> b(M); rep(i, 0, M) {
		cin >> b[i];
	}

	rep(i, 0, N)mp[a[i]]++;
	rep(i, 0, M)mp[b[i]]++;

	vector<int> v1;
	vector<int> v2;

	for (auto v : mp) {
		if (v.second == 2)v1.emplace_back(v.first);
		if (v.second >= 1)v2.emplace_back(v.first);
	}

	cout << v1.size() << " " << v2.size() << endl;
	rep(i, 0, v1.size()) { cout << v1[i] << endl; }
	rep(i, 0, v2.size()) { cout << v2[i] << endl; }
	return 0;
}


Measured memory_bytes: 15084
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)
#ifdef ONLINE_JUDGE
  #define debug(x)
  #define debug2(x,y)
  #define debug3(x,y,z)
  #define assert(e) if(!(e)){stod("");}
#else
  #define debug(x) std::cerr<<#x<<": "<<x<<"\n"
  #define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
  #define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"
#endif

using ll=long long;
using vi=std::vector<int>;
using vvi=std::vector<vi>;
using vll=std::vector<ll>;
using vvll=std::vector<vll>;
template<typename T> using vvec=std::vector<std::vector<T>>;
template<typename T>
auto make_v(size_t sz){return std::vector<T>(sz);}
template<typename T,typename... Ts>
auto make_v(size_t sz,Ts...ts){return std::vector<decltype(make_v<T>(ts...))>(sz,make_v<T>(ts...));}
template<typename T>
void fill_v(T&var,const T&x){var=x;}
template<typename V,typename T>
void fill_v(V&v,const T&x){for(auto&& w:v){fill_v(w,x);}}

template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<std::vector<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<std::deque<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s, const std::set<T>&v){
  s<<"\n";for(auto&& elm:v){s<<elm<<"\t";}s<<"\n";return s;}

inline void scan(int&a){scanf("%d",&a);}
inline void scan(ll&a){scanf("%lld",&a);}
inline void scan(char&a){scanf(" %c",&a);}
inline void scan(double&a){scanf("%lf",&a);}
template<typename T>
inline void scan(std::vector<T>&v){for(auto&& sv:v){scan(sv);}}
template<typename First,typename...Args>
inline void scan(First&f,Args&...args){scan(f);scan(args...);}
inline void scan(std::string&s){char BUF[3000000];scanf(" %s",BUF);s=std::string(BUF);}
inline void print(int a){printf("%d\n",a);}
inline void print(ll a){printf("%lld\n",a);}
inline void print(double a){printf("%.12f\n",a);}
inline void print(std::string s){std::cout<<s<<"\n";}

using namespace std;

void solve() {
  vi x(5);
  scan(x);
  rep (i, 5) {
    if (x.at(i) == 0) {
      print(i + 1);
      return;
    }
  }
}

int main() {
  solve();
  return 0;
}

Measured memory_bytes: 3228
#include<stack>
#include<queue>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
static const int INFTY = (1 << 21);
int main(){
	int n, m, a, b, cost, time;
	int kk, p, q, r;
	int sta_c[101][101];
	int sta_t[101][101];
	while (cin >> n >> m, n, m){
		for (int i = 0; i < 101; i++){
			for (int j = 0; j < 101; j++){
				sta_c[i][j] = sta_t[i][j] = INFTY;
			}
		}
		for (int i = 0; i < n; i++){
			cin >> a >> b >> cost >> time;
			sta_c[a][b] = cost; sta_c[b][a] = cost;
			sta_t[a][b] = time; sta_t[b][a] = time;
		}
		for (int k = 1; k <= m; k++){
			for (int i = 1; i <= m; i++){
				if (sta_c[i][k] == INFTY) continue;
				for (int j = 1; j <= m; j++){
					if (sta_c[k][j] == INFTY) continue;
					sta_c[i][j] = min(sta_c[i][j], sta_c[i][k] + sta_c[k][j]);
					sta_t[i][j] = min(sta_t[i][j], sta_t[i][k] + sta_t[k][j]);
				}
			}
		}
		cin >> kk;
		for (int i = 0; i < kk; i++){
			cin >> p >> q >> r;
			if (r == 0) cout << sta_c[p][q] << endl;
			else cout << sta_t[p][q] << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1236
N,A,B,C=map(int,input().split())
M=10**9+7
def inv(x):return pow(x,M-2,M)
a=A*inv(A+B)
b=B*inv(A+B)
z=0
f=[1]
for i in range(1,2*N):
	f+=f[i-1]*i%M,
def com(n,k):
	return f[n]*inv(f[k])*inv(f[n-k])%M
for i in range(N):
	z+=(N+i)*com(N-1+i,i)*(pow(a,N,M)*pow(b,i,M)+pow(b,N,M)*pow(a,i,M))
	z%=M
print(z*100*inv(100-C)%M)

Measured memory_bytes: 11052
import math

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

end_flag = False
count = sum(leaf)
ans = 0
node = 1

for i in range(N+1):
    if end_flag:
        break
    ans += node
    count -= leaf[i]
    node = min(count, (node-leaf[i])*2)

    if node < 0:
        end_flag = True

if end_flag:
    print('-1')
else:
    print(ans)

Measured memory_bytes: 20076
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <cstring>
#include <cctype>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <complex>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for(int i = a; i < (int)b; i++)
#define pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;
const int INF = 1<<28;
const ll MOD = 1000000007;

int cnt;
string s[2][10];
bool same[10];

bool chk(string &a, string &b, int &pnt) {
	REP(i, 5) {
		if(a[i*5 + pnt - 5] == b[i])
			return false;
	}
	return true;
}

void dfs(int pnt, string done, bool b[2][10]) {
	if(pnt == 10) {
		/*
		//debug
		REP(i, 10) {
			REP(j, 5) {
				cout << done[i*5 + j] << ' ';
			}
			cout << endl;
			if(i == 4) cout << "-----" << endl;
		}
		cout << endl;
		*/
		cnt++;
		return;
	}
	if(pnt < 5) {
		REP(i, 2) REP(j, 10) {
			if(!b[i][j]) {
				b[0][j] = true;
				b[1][j] = true;
				dfs(pnt+1, done + s[i][j], b);
				b[0][j] = false;
				if(!same[j]) b[1][j] = false;
			}
		}
	}
	else {
		REP(i, 2) REP(j, 10) {
			if(!b[i][j] && chk(done, s[i][j], pnt)) {
				b[0][j] = true;
				b[1][j] = true;
				dfs(pnt+1, done + s[i][j], b);
				b[0][j] = false;
				if(!same[j]) b[1][j] = false;
			}
		}
	}
	return;
}

int main() {
	string in;
	while(cin >> in, in != "END") {
		bool b[2][10] = {};
		REP(i, 10) {
			if(i)
				cin >> in;
			s[0][i] = in;
			reverse(in.begin(), in.end());
			s[1][i] = in;
			same[i] = s[0][i] == s[1][i] ? true:false;
		}
		cnt = 0;
		dfs(0, "", b);
		cout << cnt / 8 << endl;
	}
	return 0;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
using namespace std;
using ll = long long;
using ld = long double;

const double PI=acos(-1);

int main(){
  ios_base::sync_with_stdio(false);cin.tie(0);
  cout << fixed << setprecision(10);
  double R;
  cin >> R;

  cout << 2*R*PI << endl;

  return 0;
}

Measured memory_bytes: 3792
#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using ll = long long;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
  ll modpow(ll x, ll b){
    ll res = 1;
    while(b){
      if(b&1)res = res * x % MOD;
      x = x * x % MOD;
      b>>=1;
    }
    return res;
  }

  ll modinv(ll x){
    return modpow(x, MOD-2);
  }

  bool was_output = false;
  template<class t>
  void output(t a){
    if(was_output)cout << " ";
    cout << a;
    was_output = true;
  }
  void outendl(){
    was_output = false;
    cout << endl;
  }
  ll in(){
    ll res;
    scanf("%lld", &res);
    return res;
  }

  template<class t>
  istream& operator>>(istream&is, vector<t>&x){
    for(auto &i:x)is >> i;
    return is;
  }

  template<class t, class u>
  istream& operator>>(istream&is, pair<t, u>&x){
    is >> x.first >> x.second;
    return is;
  }

  template<class t>
  void in(t&x){
    cin >> x;
  }

  template<class t>
  t in(){
    t res; cin >> res; return res;
  }

  template<class t>
  void out(t x){
    cout << x;
  }

  template<class t>
  vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
    sort(line.begin(),line.end(),comp);
    return line;
  }

  template<class t>
  vector<t> reversed(vector<t> line){
    reverse(line.begin(),line.end());
    return line;
  }
}

using namespace templates;

int main(){
  int n = in();
  vector<int> line;
  rep(i,n)line.emplace_back(i+1);
  do{
    foreach(i,line)output(i);
    outendl();
  }while(next_permutation(all(line)));


}



Measured memory_bytes: 3256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef vector<vll> vvll;
typedef std::vector<std::pair<int, int> > vpi;
typedef vector<vpi> vvpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;
const unsigned gen_seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937_64 gen(gen_seed);

#define all(c) (c).begin(),(c).end()
#define forn(i, a, b) for(int i = a; i < b; i++)
#define read(x) scanf("%d", &x)
#define readv(x, n) vi x(n); forn(i,0,n) scanf("%d", &x[i])

#define pb push_back
#define mp make_pair


int main()
{
    int x,y;
    cin>>x>>y;
    if(x%y==0) cout<<-1;
    else cout<<x;
}


Measured memory_bytes: 256
#200以下で約数が8つの自然数は24, 30, 40, 42, 54, 56, 66, 70, 78, 88, 102, 104, 105, 110, 114, 128, 130, 135, 136, 138, 152, 154, 165, 170, 174, 182, 184, 186, 189, 190, 195
#うち奇数であるものは105,135,165,189,195
n = int(input())

if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n < 189:
    print(3)
elif n < 195:
    print(4)
else:
    print(5)




Measured memory_bytes: 2940
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <string>
#include <math.h>
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

int gcd(int a, int b)
{
        return b ? gcd(b, a % b) : a;
}
int main()
{
        //input->compute->output//
        int N, Y;
        cin >> N >> Y;
        int ans = 0;
        for (int a = 0; a < N + 1; a++)
        {
                for (int b = 0; b < N + 1; b++)
                {

                        int c = Y / 1000 - 10 * a - 5 * b;
                        if (c >= 0 && N >= c && a + b + c == N)
                        {
                                cout << a << ' ' << b << ' ' << c << endl;
                                return 0;
                        }
                }
        }

        cout << -1 << ' ' << -1 << ' ' << -1 << endl;
        return 0;
}


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

int main(){
  int N,K,Q; cin >>N>>K>>Q;
  
  vector<int> cor(N);
  for(int i=0;i<Q;i++){
    int x;cin >>x;
    cor[x-1] ++;
  }
  for(int i=0;i<N;i++){
    if((Q - cor[i]) >= K) cout << "No" << endl;
    else cout << "Yes" << endl;
  }
}

Measured memory_bytes: 1024
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right
def f(l, r, kousa=1):
    n = (r - l) // kousa
    return (r + l) * (n + 1) // 2

def solve():
    N, K = MI()
    ans = 0
    MOD = 1000000007
    for i in range(K, N+2):
        mn = f(0, i-1)
        mx = f(N-i+1, N)
        ans = ans + mx - mn + 1
    print(ans % MOD)

if __name__ == '__main__':
    solve()


Measured memory_bytes: 9172
#include "bits/stdc++.h"
using namespace std;

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(i = 0; i < n; i++)
#define Rep(i, n) for(i = 1; i < n; i++)
#define Ans(s) cout << s << endl;

const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

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

typedef long long ll;

// 4,8方向に探索する際に用いる配列
//int dx[4] = { 0,  0, 1, -1 };
//int dy[4] = { 1, -1, 0,  0 };
//int dx[8] = { 1, 0, -1,  0, 1, -1, -1,  1 };
//int dy[8] = { 0, 1,  0, -1, 1,  1, -1, -1 };

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

	if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0)
	{
		cout << "Possible" << endl;
	}
	else cout << "Impossible" << endl;
}


Measured memory_bytes: 256
g 0 a b c = b
g n a b c = g (n-1) (a+b+c) a b
f n = g n 1 1 0

ans i =
  let d = f i
      y = d `div` (365*10)
      m = d `mod` (365*10)
  in
    if m == 0
    then y
    else y+1

main = do
  c <- getContents
  let i = takeWhile (/= 0) $ map read $ lines c :: [Int]
      o = map ans i
      f'= map f [1..10]
      g'= map (\n -> g n 1 1 0)  [1..10]
  mapM_ print o

Measured memory_bytes: 3956
sd = input()
ok = 0
if sd[0] == 'R':
    if sd[1] == 'R':
        if sd[2] == 'R':
            ok = 1
            print(3)
        else:
            ok = 1
            print(2)
    else:
        ok = 1
        print(1)
else:
    if sd[1] == 'R':
        if sd[2] == 'R':
            ok =1 
            print(2)
        else:
            ok = 1
            print(1)
    else:
        if sd[2] == 'R':
            print(1)
            ok = 1
if ok == 0:
    print(0)


Measured memory_bytes: 61904
package main

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

// https://atcoder.jp/contests/abc167/tasks/abc167_b
func main() {
	var lines []string
	stdin := bufio.NewScanner(os.Stdin)
	for stdin.Scan() {
		lines = append(lines, stdin.Text())
	}
	// A B C K (1 0 -1 K枚）の最大をとる
	cards := strings.Split(lines[0], " ")
	one, _ := strconv.Atoi(cards[0])
	zero, _ := strconv.Atoi(cards[1])
	minus, _ := strconv.Atoi(cards[2])
	count, _ := strconv.Atoi(cards[3])
	result := 0;

	for i := 0; i < count; i++ {
		if one > 0 {
			result++
			one--
		} else if zero > 0 {
			zero--
		} else {
			result--
			minus--
		}
	}

	fmt.Println(result)

}


Measured memory_bytes: 1784
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define inf 1000000000000000
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;


int main()
{
   FAST/**/
   
   ll n,k,s;
   cin>>n>>k>>s;
   
   if(2*s>=1000000000)
   {
       ll temp = s/n - 5;
       for(ll i=0;i<k;i++)
        cout<<s<<" ";
   for(ll i=k;i<n;i++)
        cout<<temp<<" ";
    return 0;    
   }
   
   for(ll i=0;i<k;i++)
        cout<<s<<" ";
   for(ll i=k;i<n;i++)
        cout<<2*s<<" ";
   
   return 0;        
}  
   

Measured memory_bytes: 1280