akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

#define TRACE
 
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define ll   long long 
#define ld long double
#define all(v) v.begin(),v.end()
#define pb push_back
#define S second
#define F first
#define die() return 0;
 
#define md          1000000007
#define fmd         998244353 
#define M           1000011
#define N            18
ll exp(ll a,ll b){if(b<0)return 0;ll r=1;while(b){if(b&1)r=r*a%md,r%=md;a=a*a%md;b/=2;}return r;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}

int solve(){
    ll n,i,j,k,m,x,y,z;
    cin>>n;
    vector<ll> v(3*n+1);
    for(i=1;i<=3*n;++i)cin>>v[i];
    vector<ll> l(3*n+10);
	priority_queue<ll> pq;

	for(i=1;i<=n;++i)pq.push(-v[i]),l[i]=l[i-1]+v[i];
	for(i=n+1;i<=2*n;++i){
		ll mn=-pq.top();pq.pop();
		l[i]=l[i-1]-mn;
		ll next=v[i];
		pq.push(-max(mn,v[i]));
		l[i]+=max(mn,v[i]);
	}
	while(pq.size())pq.pop();
	vector<ll> r(3*n+10);
	for(i=3*n;i>2*n;--i)pq.push(v[i]),r[i]=r[i+1]-v[i];
	for(i=2*n;i>=n;--i){
		ll mn=pq.top();pq.pop();
		r[i]=r[i+1]+mn;
		ll nxt=min(mn,v[i]);
		pq.push(nxt);
		r[i]-=nxt;
	}
	ll ans=-1e18;
	for(i=n;i<=2*n;++i){
		ans=max(ans,l[i]+r[i+1]);
	}
	cout<<ans<<"\n";

	die();
}
 
 
int main(){
 
 
#ifndef ONLINE_JUDGE
    double _tBeg=clock();
#endif

     
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

    int t;
    t=1;;
    // prec();
    // cin>>t;
 
    while(t--){

        solve();
    }
 
 
 
 


#ifndef ONLINE_JUDGE
    double _tEnd=clock();
    // printf("\ntotal time %.6f\n",(_tEnd-_tBeg)/CLOCKS_PER_SEC);
#endif
 
    die();
}

Measured memory_bytes: 8180
import sys

sys.setrecursionlimit(1000000)


def input():
    return sys.stdin.readline()


n, q = [int(i) for i in input().split()]
ab = [[] for _ in range(n)]
for _ in range(n - 1):
    i, j = [int(i)-1 for i in input().split()]
    ab[i].append(j)
    ab[j].append(i)
p = [0]*n
for _ in range(q):
    i, j = [int(i) for i in input().split()]
    p[i-1] += j

al = [False]*n
pp = [0]*n


def a(i=0, j=0):
    al[i] = True
    j += p[i]
    pp[i] = str(j)
    for k in ab[i]:
        if not al[k]:
            a(k, j)


a()
print(" ".join(pp))


Measured memory_bytes: 289228
import java.util.*;

public class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] h = new int[n];
        for(int i = 0; i < n; i++) h[i] = scan.nextInt();
        int out = 1;
        for(int i = 1; i < n; i++){
            boolean ok = true;
            for(int j = 0; j < i; j++){
                if(h[i] < h[j]) {
                    ok = false;
                }
            }
            if(ok) out++;
        }
        System.out.println(out);
    }
    
    public static void main(String[] args){
        new Main().solve();
    }
}

Measured memory_bytes: 35732
from collections import defaultdict

def main():
    N = int(input())
    A = [int(input()) for _ in range(N)] + [0]

    ans = 0
    for i in range(N):
        ans += A[i] // 2
        if A[i] % 2 == 1:
            if A[i+1] >= 1:
                ans += 1
                A[i+1] -= 1

    print(ans)



    
    


if __name__ == "__main__":
    main()

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

int main()
{
	string S;
	long long K;
	cin >> S >> K;

	int n1 = 0;
	int N = S.size();
	
	for( int i = 0; i < N; i++ ) {
		if( S[i] == '1' ) n1++;
		else break;
	}
	char ans = '1';
	if( K > n1 ) ans = S[n1];

	cout << ans << endl;
}


Measured memory_bytes: 3600
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI acos(-1.0)
#define INF 10000000

typedef long long ll;

int n, a, b, c = 0;
vector< pair<int, int> > vpi;
bool f = 0;

int main() {
	while (cin >> n){
		if (!n)break;
		REP(i, n){
			cin >> b >> a;
			pair<int, int> pi;
			pi.first = a;
			pi.second = b;
			vpi.push_back(pi);
		}
		sort(ALL(vpi));
		REP(i, n){
			c += vpi[i].second;
			if (c > vpi[i].first){
				f = 1;
			}
		}
		f ? cout << "No\n" : cout << "Yes\n";
		c = 0;
		f = 0;
		vpi.clear();
	}
}

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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n, k;
	cin >> n >> k;

	vl a(n), b(n);
	FOR(i,0,n) cin >> a[i];
	FOR(i,0,n) cin >> b[i];

	sort(all(a), greater<ll>());
	sort(all(b));
	
	auto check = [&](ll t) {
		ll rem = k;
		FOR(i,0,n) {
			ll na = t/b[i];
			rem -= max(a[i]-na,0LL);
			if (rem < 0) return false;
		}
		return true;
	};
	
	ll tmin = -1, tmax = 1e18;
	while (tmax-tmin > 1) {
		ll t = (tmin+tmax)/2;
		(check(t) ? tmax : tmin) = t;
	}
	cout << tmax << endl;
}



Measured memory_bytes: 3456
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	long long int a[101],b,i,n;
	scanf("%lld",&n);
	for(i=0;i<n;i++)
	scanf("%lld",&a[i]);
	if(n==1)
	printf("%lld\n",a[0]);
	else{
	b=a[0]/(__gcd(a[1],a[0]))*a[1];
	for(i=2;i<n;i++){
		b=a[i]/(__gcd(a[i],b))*b;
	}
	printf("%lld\n",b);
    }
	return 0;
}

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

int main(){
  int N;
  cin >> N;
  
  vector<tuple<string, int, int>> restaurant;
  
  for(int i = 0; i < N; i++) {
    int a;
    string str;
    cin >> str >> a;
    
    restaurant.emplace_back(str, a * (- 1), i + 1);
  }
  
  sort(restaurant.begin(), restaurant.end());
  
  for (tuple<string, int, int> t : restaurant){
    string str1;
    int aa, bb;
    tie(str1, aa, bb) = t;
    cout << bb << endl;
  }
  
  return 0;  
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

#define INF 1<<30

vector<int> tree[2010];

int dfs(int n, int f, int d){
  if(d<=0) return 1;
  int res=1;
  rep(i,tree[n].size()) if(tree[n][i]!=f){
    res += dfs(tree[n][i], n, d-1);
  }
  return res;
}

int main(){
  int n,k;
  cin>>n>>k;
  rep(i,n-1){
    int a,b;
    scanf("%d %d", &a, &b);
    a--;b--;
    tree[a].pb(b);
    tree[b].pb(a);
  }

  if(n<=k){ cout<<0<<endl; return 0; }

  if(k%2==0){
    int res=-1;
    rep(i,n){
      res = max(res, dfs(i, -1, k/2));
    }
    cout<<n-res<<endl;
  } else {
    int res=-1;
    rep(i,n){
      for(int j : tree[i]){
        res = max(res, dfs(i, j, k/2) + dfs(j, i, k/2));
      }
    }
    cout<<n-res<<endl;
  }
  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define int long long
#define double long double
using namespace std;
const int MOD =  1000000007;
const int INF = 1e11;
using Graph = vector<vector<int>>;

struct UnionFind{
  vector<int> Par;

  //N個の独立した根として初期化
  UnionFind(int N) : Par(N) {
    for(int i = 0; i < N; i++) Par[i] = i;
  }

  //どこの根に属するか得る再帰関数
  int root(int X){
    if( Par.at(X) == X ) return X;
    else return Par.at(X) = root(Par.at(X));
  }

  //XとYが同じ根に属するか判定
  bool same(int X, int Y){
    return root(X) == root(Y);
  }

  //XとYの木を合体
  void unite(int X, int Y){
    X = root(X);
    Y = root(Y);
    if( X == Y ) return;
    Par.at(X) = Y;
  }
};

signed main(){
  int N, M;
  cin >> N >> M;

  UnionFind UF(N);
  for( int i = 0; i < M; i++ ){
    int A, B;
    cin >> A >> B;
    A--; B--;
    UF.unite(A, B);
  }

  set<int> num;
  for( int i = 0; i < N; i++ ){
    num.insert(UF.root(i));
  }
  cout << num.size()-1 << endl;

}


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

int main() {

  int n;

  while(1) {
  cin >> n;
  if(n == 0) break;
  
  vector <int> a;
  
 a.resize(n+1);
  for(int i=0;i<n+1;i++) cin >> a[i];
  
  int b;
  int count[2] = {0};
  b = a[1]-a[0];
  for(int i=0;i<n;i++) {
    if(a[i+1] - a[i] !=b) break;
    count[0]++;
  }
  
  b = a[n]-a[n-1];
  for(int i=n;i>0;i--) {
    if(a[i] - a[i-1] != b) break;
    count[1]++;
  }

  //  cout << count[0] <<" " << count[1] << endl;

  if(count[1] > count[0]) cout << a[n-count[1]-1] << endl;
  else cout << a[count[0]+1] << endl;
  
  }
  
  return 0;
}

Measured memory_bytes: 1200
// clang-format off
	#include <bits/stdc++.h>
	using namespace std; using ll = long long; using uint = unsigned int; using ull = unsigned long long;
	#define SFINAE(x, ...)	template <class, class = void> struct x : false_type {}; template <class T> struct x<T, void_t<__VA_ARGS__>> : true_type {};
	SFINAE(DefaultIO, decltype(cout << declval<T &>()))
	SFINAE(IsTuple, typename tuple_size<T>::type)
	SFINAE(Iterable, decltype(begin(declval<T>())))
	template <class T> constexpr char Space(const T &) { return (Iterable<T>::value or IsTuple<T>::value) ? '\n' : ' '; }
	template <auto &os> struct Writer {
		template <class T> void Impl(T const &t) const {
			if constexpr (DefaultIO<T>::value) os << t;
			else if constexpr (Iterable<T>::value) { int i = 0; for (auto &&x : t) ((i++) ? (os << Space(x), Impl(x)) : Impl(x)); }
			else if constexpr (IsTuple<T>::value) apply([this](auto const &... args) { int i = 0; (((i++) ? (os << ' ', Impl(args)) : Impl(args)), ...);}, t);
			else static_assert(IsTuple<T>::value, "No matching type for print");
		}
		template <class F, class... Ts> auto &operator()(F const &f, Ts const &... ts) const { return Impl(f), ((os << ' ', Impl(ts)), ...), os << '\n', *this; }
	};
	template <auto &is> struct Reader {
		template <class T> auto& Rd(T &t) const {
			if constexpr (DefaultIO<T>::value) is >> t;
			else if constexpr (Iterable<T>::value) for (auto &x : t) Rd(x);
			else if constexpr (IsTuple<T>::value) apply([this](auto &... args) { (Rd(args), ...); }, t);
			else static_assert(IsTuple<T>::value, "No matching type for read");
			return *this;
		}
		template <class T> auto operator[](T t) const { Rd(t); return t; }
		template <class... Ts> auto operator()(Ts... ts) const { (Rd(ts), ...); return tuple{move(ts)...}; }
	};
	#ifdef NARUT_LOCAL
	#define Debug(...) cerr << "\033[0;31m", Writer<cerr>{}(__VA_ARGS__), cerr << "\033[0m"
	#define ASSERT(...) if(not(__VA_ARGS__)) throw runtime_error("local assertion failed")
	#define LOCAL_ONLY(...) __VA_ARGS__
	#else
	#define Debug(...) 0
	#define ASSERT(...) 0
	#define LOCAL_ONLY(...) 0;
	#endif
	[[maybe_unused]] constexpr Reader<cin> Cin; [[maybe_unused]] constexpr Writer<cout> Cout;
	#define FOR(i, j, n) for (int i = int(j); i < int(n); ++i)
	#define ROF(i, j, n) for (int i = int(n) - 1; i >= int(j); --i)
	#define let auto const

// clang-format on





auto Main() {
	string s;
	cin>>s;
	ll a = accumulate(s.begin(),s.end(),0ll,[](ll x, char c) {
		return x + c - '0';
	});
	cout << ((a%9==0) ? "Yes\n" : "No\n");	
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout << fixed << setprecision(10);
#ifdef NARUT_LOCAL
	assert(freopen("io/test.in", "r", stdin));
	cin.exceptions(cin.badbit | cin.failbit);
	cerr << fixed << setprecision(10);
#endif

	Main();
}


Measured memory_bytes: 3780
n, k = map(int, input().split())
hh = []
minn = 10**12
for i in range(n):
    h = int(input())
    hh.append(h)
h = sorted(hh)
for i in range(n - k + 1):
    if h[i + k - 1] - h[i] < minn:
        minn = h[i + k - 1] - h[i]
print(minn)


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

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b,c;
  string s,t;
  cin >>a>>b;
  cout <<(a*(a-1)+b*(b-1))/2;
}

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

using namespace std;
string s;

int main(void) {
	cin >> s;

	int num = 0;

	for (int i = 0; i < s.size(); i++) {
		num += s[i] - '0';
	}

	if (num % 9 == 0) { cout << "Yes" << endl; }
	else { cout << "No" << endl; }

	return 0;
}

Measured memory_bytes: 3756
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

#define s (1<<18)

class segtree
{
public:
	ll seg[s*2];
	ll lazy[s*2];
	void lazy_evaluate(int k)
	{
		if(k*2+2>=s*2) return ;
		lazy[k*2+2]+=lazy[k];
		lazy[k*2+1]+=lazy[k];
		seg[k*2+2]+=lazy[k];
		seg[k*2+1]+=lazy[k];
		lazy[k]=0;
	}
	ll update(int beg,int end,int idx,int lb,int ub,ll num)
	{
		if(ub<beg||end<lb)
		{
			return seg[idx];
		}
		if(beg<=lb&&ub<=end)
		{
			lazy[idx]+=num;
			seg[idx]+=num;
			return seg[idx];
		}
		if(lazy[idx])
		{
			lazy_evaluate(idx);
		}
		return seg[idx]=max(update(beg,end,idx*2+1,lb,(lb+ub)/2,num),update(beg,end,idx*2+2,(lb+ub)/2+1,ub,num));
	}
	ll query(int beg,int end,int idx,int lb,int ub)
	{
		if(ub<beg||end<lb)
		{
			return -1000000000000000000LL;
		}
		if(beg<=lb&&ub<=end)
		{
			return seg[idx];
		}
		if(lazy[idx])
		{
			lazy_evaluate(idx);
		}
		return max(query(beg,end,idx*2+1,lb,(lb+ub)/2),query(beg,end,idx*2+2,(lb+ub)/2+1,ub));
	}
}kaede;

int n;
ll d,a;
pair<ll,ll>p[200005];

int main(){
	cin>>n>>d>>a;
	rep(i,n) cin>>p[i].fi>>p[i].sc;
	sort(p,p+n);
	ll ans = 0;
	rep(i,n){
		if(p[i].sc <= kaede.query(i,i,0,0,s-1)) continue;
		ll zan = p[i].sc-kaede.query(i,i,0,0,s-1);
		ll need = (zan+a-1)/a;
		ans += need;
		int k = lower_bound(p,p+n,mp(p[i].fi+d+d+1,-1ll))-p;
		kaede.update(i,k-1,0,0,s-1,need*a);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 11136
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>

#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class DRainFlowsIntoDams {
public:
    static constexpr int kStressIterations = 0;

    static void generateTest(std::ostream& test) {
    }

    vector<int> A;
    int N;

    bool check(int x) {
        int cur = x;
        REP(i, N) {
            cur = (A[i] - cur / 2) * 2;
            //if (cur < 0) return false;
        }
        if (cur < x) return false;
        return true;
    }

    void solve(std::istream& cin, std::ostream& cout) {
        cin >> N;
        A.resize(N);
        REP(i, N) cin >> A[i];

        int l = 0;
        int r = INF;
        while (r - l > 1) {
            int m = (l + r) / 2;
            if (check(m)) {
                l = m;
            }
            else {
                r = m;
            }
        }
        if (l % 2 == 1) l--;

        int cur = l;
        REP(i, N) {
            cout << cur << " ";
            cur = (A[i] - cur / 2) * 2;
        }
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    DRainFlowsIntoDams solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 2176
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys,collections,math,fractions
sys.setrecursionlimit(1000000)
INF = float("inf")

N = int(sys.stdin.readline())
A = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
#3 8 9 10 11 12
left = [A[0]]*(N)
for i in range(1,N):
    left[i] = fractions.gcd(left[i-1],A[i])

right =[A[N-1]]*(N)
for i in range(N-1)[::-1]:
    right[i] = fractions.gcd(right[i+1],A[i])

#print(left,right)

ret = -INF
for i in range(N):
    if i-1 >= 0 and i+1 < N:
        a = fractions.gcd(left[i-1],right[i+1])
    elif i-1 >= 0:
        a = left[i-1]
    else:
        a = right[i+1]
    ret = max(ret,a)
print(ret)


Measured memory_bytes: 16236
import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.TreeMap;
import java.math.BigDecimal;
import java.math.BigInteger;
    
public class Main{
 
static final InputStream in=System.in;
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE;
static final long LINF=Long.MAX_VALUE;
 
public static void main(String[] args) throws IOException{
InputReader ir=new InputReader(in);
int a=ir.nextInt();
int b=ir.nextInt();
out.printf("%d %d %.10f\n",a/b,a%b,(double)a/b);
out.flush();
}

static class InputReader {
 private InputStream in;
 private byte[] buffer=new byte[1024];
 private int curbuf;
 private int lenbuf;
 
 public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;}
  
 public boolean hasNextByte() {
  if(curbuf>=lenbuf){
   curbuf= 0;
   try{
    lenbuf=in.read(buffer);
   }catch(IOException e) {
    throw new InputMismatchException();
   }
   if(lenbuf<=0) return false;
  }
  return true;
 }
 
 private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;}

 private boolean isSpaceChar(int c){return !(c>=33&&c<=126);}
 
 private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;}

 public boolean hasNext(){skip(); return hasNextByte();}
 
 public String next(){
  if(!hasNext()) throw new NoSuchElementException();
  StringBuilder sb=new StringBuilder();
  int b=readByte();
  while(!isSpaceChar(b)){
   sb.appendCodePoint(b);
   b=readByte();
  }
  return sb.toString();
 }
 
 public int nextInt() {
  if(!hasNext()) throw new NoSuchElementException();
  int c=readByte();
  while (isSpaceChar(c)) c=readByte();
  boolean minus=false;
  if (c=='-') {
   minus=true;
   c=readByte();
  }
  int res=0;
  do{
   if(c<'0'||c>'9') throw new InputMismatchException();
   res=res*10+c-'0';
   c=readByte();
  }while(!isSpaceChar(c));
  return (minus)?-res:res;
 }
 
 public long nextLong() {
  if(!hasNext()) throw new NoSuchElementException();
  int c=readByte();
  while (isSpaceChar(c)) c=readByte();
  boolean minus=false;
  if (c=='-') {
   minus=true;
   c=readByte();
  }
  long res = 0;
  do{
   if(c<'0'||c>'9') throw new InputMismatchException();
   res=res*10+c-'0';
   c=readByte();
  }while(!isSpaceChar(c));
  return (minus)?-res:res;
 }
 
 public double nextDouble(){return Double.parseDouble(next());}
 
 public BigInteger nextBigInteger(){return new BigInteger(next());}
 
 public int[] nextIntArray(int n){
  int[] a=new int[n];
  for(int i=0;i<n;i++) a[i]=nextInt();
  return a;
 }
 
 public char[][] nextCharMap(int n,int m){
  char[][] map=new char[n][m];
  for(int i=0;i<n;i++) map[i]=next().toCharArray();
  return map;
 }
}
}

Measured memory_bytes: 24948
a = int(input())
for i in range(a, 0, -1):
    for j in range(int(i**0.5), 1, -1):
        b = i
        while True:
            if b % j == 0:
                b = b // j
                if b == 1:
                    print(i)
                    exit()
            else:
                break
print(1)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
#define RRep(i, k, n) for (int i = k; i > (int)(n); i--)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define ALL(a)  (a).begin(),(a).end()
#define rALL(a)  (a).rbegin(),(a).rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> void PrintVector(const vector<T> &vec) {for (auto val : vec) cout << val << " "; cout << endl;}
const long long INF = 1LL << 60;
const int MOD = 1000000007;
const double PI = acos(-1); //3.14~
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    string s; cin >> s;
    vector<int> a(10);
    rep(i, s.size() - 2)
    {
        a[i] = (s[i] - '0') * 100 + (s[i + 1] - '0') * 10 + s[i + 2] - '0';
    }

    int mini = MOD;
    rep(i, a.size())
    {
        mini = min(mini, abs(753 - a[i]));
    }

    cout << mini << endl;
}

Measured memory_bytes: 256
_ = input()
A = [int(a) for a in input().split()]
for _ in range(int(input())):
    b, m, e = map(int, input().split())
    t = [0]*(e-b)
    for i in range(e-b):
        j = (i + (e-m)) % (e - b)
        t[j] = A[b+i]
    A = A[:b] + t + A[e:]
print(*A, sep=' ')


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0; i<n; i++){
    cin >> a[i];
  }
  
  int p = 0;
  
  for(int i=1; i<=n; i++){
    if(i + a[i-1] == a[i-1] + a[a[i-1]-1]){
      p++;
    }
  }
  
  cout << p/2 << endl;
  
	return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
int main(void)
{
	int i,l,m,n,x,y;
	i=1;
	scanf("%d",&n);
	m=100000;
	while(i<=n) {
		m=m*105/100;
		x=m%1000;
		if(x!=0) {
			y=1000-x;
			m=m+y;
		}
		i+=1;
	}
	printf("%d\n",m);
	return 0;
}

Measured memory_bytes: 592
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
 
int main() {
    char s[1201], g;
    int i = 0, j, a[26] = {0}, k, h;
    while(scanf("%c", &s[i]) != EOF) ++i;
    k = i;
    for (h = 0; h <= i; ++h) {
        if (isupper(s[h])) s[h] = tolower(s[h]);
        for (j = 0; j < 26; ++j) {
            g = 'a' + j;
            if (s[h] == g) {
                ++a[j];
                break;
            }
        }
    }
    for (i = 0; i < 26; ++i) {
        g = 'a' + i;
        printf("%c : %d\n", g, a[i]);
    }
}


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

const int64_t MOD = 1000000007;

#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef unsigned long long ull;


// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
      v[k][j] %= MOD;
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m  
int64_t modinv(int64_t a, int64_t m) {
    int64_t b = m, u = 1, v = 0;
    while (b) {
        int64_t t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;


signed main() {
  ll w,h,x,y;
  cin >> w >> h >> x >> y;
  
  cout << fixed << setprecision(9) << (w*h)/2.0 << " ";
  if( x>0 && w/x==2 && (w%x)==0 && y>0 && h/y==2 && (h%y)==0 ){
    cout << "1" << endl;;
  }
  else{
    cout << "0" << endl;
  }
  
  return 0;
}



Measured memory_bytes: 3688
# from collections import deque
# from heapq import heapify,heappop,heappush,heappushpop
# from copy import copy,deepcopy
# from itertools import permutations,combinations
# from collections import defaultdict,Counter
# from pprint import pprint

def myinput():
    return map(int,input().split())

# def mycol(data,col):
#     return [ row[col] for row in data ]

# def mysort(data,col):
#     data.sort(key=lambda x:x[col],reverse=False)
#     return data

# def mymax(data):
#     M = -1*float("inf")
#     for i in range(len(data)):
#         m = max(data[i])
#         M = max(M,m)
#     return M

# def mymin(data):
#     m = float("inf")
#     for i in range(len(data)):
#         M = min(data[i])
#         m = min(m,M)
#     return m

class UnionFind():
    # parentsは「要素が根の場合に"そのグループの要素数*(-1)"を格納するリスト」
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
    # 要素xが属するgroupの根を返す
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    # 要素xが属するgroupと要素yが属するgroupを併合する
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x
    # 要素xが属するgroupのサイズ（要素数）を返す
    def size(self, x):
        return -self.parents[self.find(x)]
    # 要素x,yが同じgroupに属するかをTrueかFalseで返す
    def same(self, x, y):
        return self.find(x) == self.find(y)
    # 要素xが属するgroupに属する要素をリストで返す
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    # 全ての根の要素をリストで返す
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    # groupの数を返す
    def group_count(self):
        return len(self.roots())
    # {ルート要素: [そのグループに含まれる要素のリスト], ...}の辞書を返す
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    # ルート要素: [そのグループに含まれる要素のリスト]を文字列で返す
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n,m = myinput()
p = list(myinput())
xy = [ list(myinput()) for _ in range(m) ]

uf = UnionFind(n)

for i in range(m):
    x = xy[i][0] - 1
    y = xy[i][1] - 1
    uf.union(x,y)

count = 0
for i in range(n):
    tmp = p[i] - 1
    if tmp==i:
        pass
    else:
        if uf.same(i,tmp):
            pass
        else:
            count += 1
            
# print(count)
ans = n - count
print(ans)

Measured memory_bytes: 100588
class Dice
    @up = ''
    def initialize(n)
        @up = n[0]
        @front = n[1]
        @right = n[2]
        @left = n[3]
        @back = n[4]
        @down = n[5]
    end

    def move(direction)
        case direction
        when 'S'
            tmp = @up
            @up = @back
            @back = @down
            @down = @front
            @front = tmp
        when 'W'
            tmp = @up
            @up = @right
            @right = @down
            @down = @left
            @left = tmp
        when 'E'
            tmp = @up
            @up = @left
            @left = @down
            @down = @right
            @right = tmp
        when 'N'
            tmp = @up
            @up = @front
            @front = @down
            @down = @back
            @back = tmp
        end
    end
    def displayUp
        puts @up
    end
end

x = gets.split.map(&:to_i)
directions = gets.chomp
dice = Dice.new(x)
directions.split('').each{|d| dice.move(d)}
dice.displayUp


Measured memory_bytes: 6876
#include <bits/stdc++.h>
 
#define f(i,a,b) for( ll i = a; i < b ; i++ )
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(x) (ll) __builtin_popcount(x)
#define fs first
#define sc second
#define pb push_back
#define po pop_back
#define mp make_pair 
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ller ios::sync_with_stdio(false);cin.tsie(nullptr);cout.tie(nullptr)
#define watch(x) cout << (#x) << " is " << (x) <<"\n"
#define PI 3.1415926535
using namespace std;
typedef long long ll;
typedef long double ld; 
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;
const ll mod = 1e9+7;
const ll MAX = 1e6+10;
const ll inf = 1e18+7;

ll fun(ll n){
	return (n*(n-1))/2;
}

int main(){
	fastio;
	ll n,m;
	cin>>n>>m;
	cout<<fun(n)+fun(m)<<"\n";
    return 0; 
}

Measured memory_bytes: 3636
s = str(input())
t = str(input())
flag = True
if(len(s) == len(t)-1):
  x = len(s)
  for i in range(x):
    if s[i]!=t[i]:
      flag = False
else:
    flag = False
if(flag):
  print("Yes")
else:
  print("No")

Measured memory_bytes: 9120
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>
#include <set>
#include <map>

using namespace std;

#define EPS 1e-14
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) FOR(i, 0, n)
#define PI 2*acos(0.0)
#define ALL(a) (a).begin(),(a).end()
#define DEBUG(x) cout<<#x <<": "<< x << "\n"
#define DEBUG_ARR(a) REP(i, size(a)){ cout << #a << "[" << i << "]: " << a[i] << "\n"; }
const int VX[] = { 0, 1, 0, -1 };
const int VY[] = { 1, 0, -1, 0 };
const long long MOD = pow(10, 9) + 7;

typedef long long ll;

int main() {
	//	--- I/O 高速化 ---
	cin.tie(0);
	ios::sync_with_stdio(false);
	// --- ここまで ---

	int n, m;
	cin >> n >> m;

	vector<ll> x(n);
	vector<ll> y(m);

	REP(i, n) cin >> x[i];
	REP(i, m) cin >> y[i];

	ll ans, ans_x = 0, ans_y = 0, c;
	REP(i, n / 2) {
		c = 2 * i - n + 1;
		ans_x = (ans_x + (c * x[i]) - (c * x[n - i - 1])) % MOD;
	}

	REP(i, m / 2) {
		c = 2 * i - m + 1;
		ans_y = (ans_y + (c * y[i]) - (c * y[m - i - 1])) % MOD;
	}

	ans_x %= MOD;
	ans_y %= MOD;
	ans = (ans_x * ans_y) % MOD;

	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 1792
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>

using LL = long long;
LL powers[18];
const int MOD = (int)1e9 + 7;

const int kThreshold = 8;

int power(int a, int b, int p)
{
    int ret = 1;
    for ( ; b; b >>= 1, a = a * 1LL * a % MOD)
        if (b & 1)
            ret = ret * 1LL * a % MOD;
    return ret;
}

inline void add(int &a, int b)
{
    a += b;
    if (a >= MOD) a -= MOD;
}

int main()
{
    powers[0] = 1;
    for (int i = 1; i < 18; ++ i) powers[i] = powers[i - 1] * 10;
    int S;
    scanf("%d", &S);
    int result = 0;
    int left = 1, right = 0, sum = 0, left_id = 1, right_id = 1;
    for ( ; left < powers[kThreshold - 1]; ++ left) {
        while (sum < S) {
            if (++ right == powers[right_id])
                ++ right_id;
            sum += right_id;
        }
        if (sum == S)
            ++ result;
        if (left == powers[left_id])
            ++ left_id;
        sum -= left_id;
    }
    auto N = [](int d) {
        return ((power(10, d, MOD) - power(10, d - 1, MOD)) % MOD + MOD) % MOD;
    };
    add(result, S / kThreshold);
    for (int t = 1; t <= S / kThreshold; ++ t) if (S % t == 0) {
        add(result, (N(S / t) - t + MOD) % MOD);
    }
    printf("%d\n", result);
}


Measured memory_bytes: 256
#include <stdio.h>

int	main(void)
{
  	int	N;
  	int	K;
  	int	h[100001];
 	int	num;
  	int	i;
  	int count;
  
  	num = scanf("%d %d", &N, &K);
  	if (num != 2)
      	return (0);
  	
  	count = 0;
  	for (i=1; i<=N; i++)
    {
      	num = scanf("%d", &h[i]);
      	if (num != 1)
          	return (0);
      	if (h[i] >= K)
          	count++;
    }
  
  	printf("%d", count);
  	return (0);
}

Measured memory_bytes: 512
import java.util.*;

public class Main{
  public static void main(String[] args){
   Scanner sc = new Scanner(System.in);

   int n = sc.nextInt();
   long ans = 1;
   long[] array = new long[n];
   boolean flag = false;
   boolean flag_z = false;

   for(int i=0; i<n; i++){
     long num = sc.nextLong();
     if(num==0){
       flag_z = true;
     }
     ans *= num;
     if(ans<=0||ans>1000000000000000000L){
       flag = true;
     }

     //System.out.println("ans:"+ans);
   }

   if(flag_z){
    System.out.println(0);
  }else{
    if(flag){
      System.out.println("-1");
    }else{
      System.out.println(ans);
    }
  }



   // System.out.println(900000000000000000L*900000000000000000L);
   //
   // String bin = Long.toBinaryString(1000000000000000000L);
   // System.out.println(bin);
   // System.out.println(bin.length());

   // for(long i=1000000000000000000L; i>1e17; i--){
   //   System.out.println(i*1000000000000000000L);
   //   if(i*1000000000000000000L<1000000000000000000L&&i*1000000000000000000L>0){
   //     System.out.println("i"+i);
   //     break;
   //   }
   // }
   //999999999999999988
  }
}

Measured memory_bytes: 61044
import math
n, h = map(int, input().split())
AB = [[0,0] for _ in range(n)]
mxA, mxB = 0, 0
for i in range(n):
    AB[i] = list(map(int,input().split()))
    if (mxB==0) or (mxA == AB[i][0] and mxB > AB[i][1]) or (mxA < AB[i][0]):
        mxA, mxB = AB[i][0], AB[i][1]

ans = 0
AB.sort(key=lambda x: x[1], reverse=True)
mxAi = AB.index([mxA,mxB])
for i in range(n):
    if i!=mxAi and AB[i][1]>mxA and h>0:
        h -= AB[i][1]
        ans += 1
if h>0:
    ans += max(1, 1+math.ceil((h-mxB)/mxA))
print(ans)

Measured memory_bytes: 28588
#include<stdio.h>

int Fib[45];

void makeFibonacci(void );

void makeFibonacci(){
  int i;
  Fib[0]=1;
  Fib[1]=1;
  for(i=2 ; i<45 ; i++) Fib[i]=Fib[i-2]+Fib[i-1];
}

int main(){
  int n;

  makeFibonacci();
  scanf("%d",&n);
  printf("%d\n",Fib[n]);

  return 0;
}

Measured memory_bytes: 596
n,k = map(int,input().split())
info =[list(map(int,input().split())) for i in range(n)]

info =sorted(info)

for i in range(n):
  if info[i][1]>=k:
    print(info[i][0])
    exit()
  else:
    k = k - info[i][1]


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

#define pb push_back
#define ppp pop_back
#define fi first
#define se second
#define pii pair<int,int>

const int N = 1e5 + 5;

ll a[N];
vector<ll> b, c;
bool used[N];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    int n;
    cin >> n;
    for (int i=1; i<=n; i++) cin >> a[i];
    sort(a+1, a+n+1);
    for (int i=1; i<=n; i++) used[i] = false;
    int l = 1, r = n;
    for (int i=1; i<=n; i++) {
        int cur;
        if (i % 2 == 0) cur = r;
        else cur = l;
        b.pb(a[cur]);
        if (i % 2 == 0) r--;
        else l++;
    }
    l = 1, r = n;
    for (int i=1; i<=n; i++) {
        int cur;
        if (i % 2 == 0) cur = l;
        else cur = r;
        c.pb(a[cur]);
        if (i % 2 == 0) l++;
        else r--;
    }
    ll sum1 = 0, minv1 = 1e18;
    for (int i=0; i<n-1; i++) {
        sum1 += abs(b[i+1] - b[i]);
        minv1 = min(minv1, abs(b[i+1] - b[i]));
    }
    sum1 += abs(b[0] - b[n-1]);
    minv1 = min(minv1, abs(b[0] - b[n-1]));
    ll sum2 = 0, minv2 = 1e18;
    for (int i=0; i<n-1; i++) {
        sum2 += abs(c[i+1] - c[i]);
        minv2 = min(minv2, abs(c[i+1] - c[i]));
    }
    sum2 += abs(c[0] - c[n-1]);
    minv2 = min(minv2, abs(c[0] - c[n-1]));
    ll ans1 = sum1 - minv1;
    ll ans2 = sum2 - minv2;
    cout << max(ans1, ans2) << "\n";
    return 0;
}


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

typedef long long long64;

long64 inline distance(long64 s, long64 t, long64 p)
{
	long64 d = abs(s - t);
	long64 d1 = abs(p - s);
	long64 d2 = abs(p - t);

	if (d1 < d2)
		return d1 + d;
	else
		return d2 + d;
}

int main()
{
	size_t s_num, t_num, p_num;
	std::cin >> s_num >> t_num >> p_num;

	std::vector<long64> s(s_num);
	std::vector<long64> t(t_num);
	std::vector<long64> p(p_num);

	for (size_t i = 0; i < s_num; i++)
	{
		std::cin >> s[i];
	}

	for (size_t i = 0; i < t_num; i++)
	{
		std::cin >> t[i];
	}
  
  	std::sort(s.begin(), s.end());
	std::sort(t.begin(), t.end());

	for (size_t i = 0; i < p_num; i++)
	{
		std::cin >> p[i];

		typedef std::vector<long64>::iterator it;
		it it_s_l;
		it it_s_r;
		it it_t_l;
		it it_t_r;

		auto find = [](it& l, it& r, long64 p, std::vector<long64>& array)
		{
			r = l = std::lower_bound(array.begin(), array.end(), p);
			if (r == array.end())
			{
				r--;
				l = r;
			}
			else {
				if (l != array.begin()) {
					l--;
				}
				else {
					r = l = array.begin();
				}
			}
		};

		find(it_s_l, it_s_r, p[i], s);
		find(it_t_l, it_t_r, p[i], t);

		long64 mins[4] = {};
		mins[0] = distance(*it_s_l, *it_t_l, p[i]);
		mins[1] = distance(*it_s_l, *it_t_r, p[i]);
		mins[2] = distance(*it_s_r, *it_t_l, p[i]);
		mins[3] = distance(*it_s_r, *it_t_r, p[i]);

		long64 min = mins[0];
		for (size_t i = 0; i < 4; i++) {
			if (min > mins[i]) {
				min = mins[i];
			}
		}

		std::cout << min << std::endl;
	}

	return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#include<ctime>
#include<set>
#include<map>
#include<queue>
#include<stack>
#define sqr(x) ((x)*(x))
#define fz1(i,n) for ((i)=1;(i)<=(n);(i)++)
#define fd1(i,n) for ((i)=(n);(i)>=1;(i)--)
#define fz0g(i,n) for ((i)=0;(i)<=(n);(i)++)
#define fd0g(i,n) for ((i)=(n);(i)>=0;(i)--)
#define fz0k(i,n) for ((i)=0;(i)<(n);(i)++)
#define fd0k(i,n) for ((i)=(long long)((n)-1);(i)>=0;(i)--)
#define fz(i,x,y) for ((i)=(x);(i)<=(y);(i)++)
#define fd(i,y,x) for ((i)=(y);(i)>=(x);(i)--)
#define fzin fz1(i,n)
#define fzim fz1(i,m)
#define fzjn fz1(j,n)
#define fzjm fz1(j,m)
#define ff(c,itr) for (__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define rdst(st,len){static char ss[len];scanf(" %s",ss);(st)=ss;}
#define inc(x,y) {x+=(y);if(x>=mod)x-=mod;}
#define dec(x,y) {x-=(y);if(x<0)x+=mod;}
using namespace std;
int n,m,i,j,f[5005],g[5005],dis[5005],sz[5005];
string st;
vector<int> bi[5005];
int merge(int f1,int g1,int f2,int g2)
{
	if(f1>f2){
		swap(f1,f2);
		swap(g1,g2);
	}
	if(g1>f2){
		return ((f1+f2)&1);
	}
	else{
		return f2-g1;
	}
}
void dfs(int x,int fa)
{
	vector<int> seq;
	f[x]=g[x]=0;sz[x]=(st[x-1]-'0');
	ff(bi[x],it){
		if(*it==fa)continue;
		dis[*it]=dis[x]+1;
		dfs(*it,x);
		sz[x]+=sz[*it];
		int tf=sz[*it]+f[*it],tg=sz[*it]+g[*it];
		f[x]=merge(f[x],g[x],tf,tg);
		g[x]+=tg;
	}
}
int main()
{
	cin>>n>>st;
	fz1(i,n-1){
		int x,y;
		cin>>x>>y;
		bi[x].push_back(y);
		bi[y].push_back(x);
	}
	int ans=0x3f3f3f3f;
	fz1(i,n){
		dis[i]=0;
		dfs(i,0);
		if(f[i]==0){
			int s=0;
			fz1(j,n){
				s+=(st[j-1]-'0')*dis[j];
			}
			ans=min(ans,s/2);
		}
	}
	if(ans==0x3f3f3f3f)puts("-1");else cout<<ans<<endl; 
	return 0;
}

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

#define FOR(i,l,r) for(int i = (int) (l);i < (int) (r);i++)
#define ALL(x) x.begin(),x.end()
template<typename T> bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; }
template<typename T> bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; }
typedef long long ll;

ll N;
const ll MOD = 1e9 + 7;

int main()
{
	scanf("%lld",&N);
	vector<ll> A(N);
	FOR(i,0,N){
		scanf("%lld",&A [i]);
	}
	ll ans = 1,r = 0,cnt = 1;
	FOR(i,0,N){
		while(r < N && A [r] >= cnt){
			r++;
			cnt += 2;
		}
		(ans *= min(N - i,(r - i) + 1)) %= MOD;
		cnt -= 2;
	}

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

	return 0;
}


Measured memory_bytes: 1024
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);


int main(){
	int n1,n2,n3,n4,n5,n6;
	while(cin>>n1>>n2>>n3>>n4>>n5>>n6,n1|n2|n3|n4|n5|n6){
		int n[3]={n1+n4,n2+n5,n3+n6};
		int mn=min(n[0],min(n[1],n[2]));
		int ans=0;
		if(mn>1){
			ans+=mn-1;
			REP(i,3){
				n[i]-=mn-1;
			}
		}
		REP(i,3){
			int plus=n[i]/3;
			if(plus>0){
				ans+=plus;
				n[i]-=plus*3;
			}
		}

		mn=min(n[0],min(n[1],n[2]));
		if(mn==1){
			ans++;
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 1160
h,m,s,t;main(){for(;scanf("%d%d%d",&h,&m,&s),~h;printf("%02d:%02d:%02d\n%02d:%02d:%02d\n",t/3600,t/60%60,t%60,t*3/3600,t*3/60%60,t*3%60))t=7200-h*3600-m*60-s;exit(0);}

Measured memory_bytes: 612
#include <cstdio>
#include <iostream> 
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
 
using namespace std;
using ll = long long;
using ull = unsigned long long;
 
const ll INF = 1e9;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(int i = 0; i < n; i++)
#define RREP(i, n) for(int i = n - 1; i >= 0; i--)
#define REP2(i, n, k) for(int i = 0; i < n; i += k)

int n, m;
vector<int> v[8];

int dfs(int k, bool f[]){
	int sum = 0;

	int i;
	for(i = 0; i < n; i++){
		if(!f[i])break;
	}
	if(i == n)return 1;

	for(auto x : v[k]){
		if(!f[x]){
			f[x] = true;
			sum += dfs(x, f);
			f[x] = false;
		}
	}

	return sum;
}

int main()
{
    cin >> n >> m;
	REP(i, m){
		int a, b;
		cin >> a >> b;
		a--;b--;

		v[a].push_back(b);
		v[b].push_back(a);
	}

	bool f[8] = {};
	f[0] = true;

	cout << dfs(0, f) << endl;
}

Measured memory_bytes: 256
/* Author : Pranav Deshmukh
            PICT,Pune
   Purpose: Atcoder Contest ABC172
*/

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

//#define int             long long
#define dip(type,var)   type var; cin>>var;
#define w(x)            int x; cin>>x; while(x--)
#define mka(arr,n,type) type *arr=new type[n];
#define foi(i,n)		for(int i=0;i<n;i++)
#define mod             pow(10,9)+7
#define inf             1e18
#define endl			"\n"
#define ff              first
#define ss              second
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >

void c_p_c()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
// #ifndef ONLINE_JUDGE

// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
}


int main() {
	c_p_c();
	string s1, s2;
	getline(cin,s1);
	getline(cin,s2);
	int count = 0;
	for (int i = 0; i < s1.length(); i++) {
		if (s1[i] != s2[i])
			count++;
	}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 3816
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

vector<int> v[111111], w[111111];
int visit[111111], edge[111111], ans;

void dfs(int node, int color)
{
    int i, c = 0;

    for (i = 0; i < v[node].size(); i++)
	{
		if (visit[v[node][i]])
			continue;
		visit[v[node][i]] = 1;

		++c;
		if (c == color)
			++c;

		edge[w[node][i]] = c;

		dfs(v[node][i], c);

		ans = max(ans, c);
    }
}

int main(void)
{
	int n, i;

	scanf("%d" ,&n);
	for (i = 1; i < n; i++)
	{
        int a, b;

		scanf("%d %d" ,&a, &b);

		v[a].push_back(b), v[b].push_back(a);
		w[a].push_back(i), w[b].push_back(i);
	}

	visit[1] = 1;
	dfs(1, 0);

	printf("%d\n" ,ans);
	for (i = 1; i < n; i++)
        printf("%d\n" ,edge[i]);
	return 0;
}

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

int main(void){
    int a, x;
    int result;

    cin >> x >> a;

    if(x < a){
        result = 0;
    } else {
        result = 10;
    }

    cout << result << endl;

    return 0;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: 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)]

INF = float('inf')

from math import pi
def solve():
    r = II()
    print(2 * pi * r)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 9100