#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;



int main(){
    cout << fixed << setprecision(15);

    int N; cin >> N;
    vector<ll> X; ll x; for (int i=0; i<N; i++) { cin >> x; X.push_back(x); }

    ll m_dist = 0;
    for (int i=0; i<N; i++) m_dist += abs(X[i]);
    cout << m_dist << endl;


    double u_dist = 0;
    for (int i=0; i<N; i++) u_dist += double(X[i]) * double(X[i]);
    u_dist = sqrt(u_dist);
    cout << u_dist << endl;

    ll c_dist = 0;
    for (int i=0; i<N; i++) c_dist = max(c_dist, abs(X[i]));
    cout << c_dist << endl;

    return 0;
}
#include <bits/stdc++.h>
/* #include <atcoder/all> */

#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define per(i, b) gnr(i, 0, b)

using namespace std;
/* using namespace atcoder; */

using ll = long long;
using P = pair<int, int>;

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

int main() {
  ll x, y, a, b;
  cin >> x >> y >> a >> b;
  ll tmp = x;
  ll mul = 0;
  while (y / a > tmp && (tmp * a < tmp + b)) {
    tmp *= a;
    mul++;
  }
  ll res = mul + (y - tmp - 1) / b;
  cout << res << endl;
  return 0;
}
