#include <bits/stdc++.h>
using namespace std;
#define double long double
double tree[100009]={0.0};
#define PI acos(-1)
int n;
vector<double> v,p;
void update(int idx,double val)
{
for(;idx<=100006;idx+=idx&-idx)
tree[idx]=max(tree[idx],val);
}
double read(int idx)
{
double s=0;
for(;idx>0;idx-=idx&-idx)s=max(s,tree[idx]);
return s;
}
int main()
{
cin>>n;
v.push_back(-1.0);
p.push_back(-1.0);
for(int i=1;i<=n;i++)
{
long long r,h;
cin>>r>>h;
v.push_back((double)h*r*r*PI);
p.push_back((double)h*r*r*PI);
}
//v.push_back(-1.0);
sort(v.begin(),v.end());
for(int i=1;i<=n;i++)
{
int t=(int)(upper_bound(v.begin(),v.end(),p[i])-v.begin());
double a=read(t-1)+p[i];
update(t,a);
}
double ans=0.0;
for(int i=1;i<=100006;i++)
ans=max(ans,read(i));
printf("%0.14Lf\n",ans);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgZG91YmxlIGxvbmcgZG91YmxlCmRvdWJsZSB0cmVlWzEwMDAwOV09ezAuMH07CiNkZWZpbmUgUEkgYWNvcygtMSkKaW50IG47CnZlY3Rvcjxkb3VibGU+IHYscDsKdm9pZCB1cGRhdGUoaW50IGlkeCxkb3VibGUgdmFsKQp7Cglmb3IoO2lkeDw9MTAwMDA2O2lkeCs9aWR4Ji1pZHgpCgkJdHJlZVtpZHhdPW1heCh0cmVlW2lkeF0sdmFsKTsKfQpkb3VibGUgcmVhZChpbnQgaWR4KQp7Cglkb3VibGUgcz0wOwoJZm9yKDtpZHg+MDtpZHgtPWlkeCYtaWR4KXM9bWF4KHMsdHJlZVtpZHhdKTsKCXJldHVybiBzOwp9CmludCBtYWluKCkgCnsKCWNpbj4+bjsKCXYucHVzaF9iYWNrKC0xLjApOwoJcC5wdXNoX2JhY2soLTEuMCk7Cglmb3IoaW50IGk9MTtpPD1uO2krKykKCXsKCQlsb25nIGxvbmcgcixoOw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