#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
long long v[MAXN];
pair<long long, long long> p, q;
set<pair<long long, long long>> s;
set<pair<long long, long long>>::iterator it;
int main() {
  int n, r, h;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &r, &h);
    v[i] = 1ll * r * r * h;
  }
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    p = make_pair(v[i], v[i]);
    it = s.lower_bound(p);
    if (s.size() > 0 && it != s.begin()) {
      --it;
      q = *it;
      p.second = q.second + p.first;
    }
    while (1) {
      it = s.lower_bound(p);
      if (s.size() > 0 && it != s.end() && (*it).second < p.second) {
        s.erase(it);
        continue;
      }
      break;
    }
    s.insert(p);
    ans = max(ans, p.second);
  }
  printf("%.10lf\n", 1.0 * ans * acos(-1.0));
}
