#include <bits/stdc++.h>
using namespace std;
struct ele {
  long long vol, sum;
};
set<ele> s;
bool operator<(ele A, ele B) {
  return (A.vol < B.vol || (A.vol == B.vol && A.sum < B.sum));
}
ele make_ele(long long vol, long long sum) {
  ele aux;
  aux.vol = vol;
  aux.sum = sum;
  return aux;
}
int main() {
  int n;
  long long v, r, h;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d %I64d", &r, &h);
    v = r * r * h;
    ele aux = make_ele(v, v);
    if (!s.empty()) {
      set<ele>::iterator it = s.lower_bound(aux);
      if (it == s.end() || it != s.begin()) {
        aux.sum = (*(--it)).sum + aux.vol;
        while (true) {
          set<ele>::iterator it2 = s.lower_bound(aux);
          if (s.size() > 0 && it2 != s.end() && aux.sum > (*it2).sum) {
            s.erase(it2);
            continue;
          }
          break;
        }
        s.insert(aux);
      } else {
        s.insert(aux);
      }
    } else {
      s.insert(aux);
    }
  }
  long long maxi = 0;
  for (set<ele>::iterator it = s.begin(); it != s.end(); ++it) {
    maxi = max((*it).sum, maxi);
  }
  printf("%.9lf\n", acos(-1) * maxi);
  return 0;
}
