Problem: As you know, every birthday party has a cake! This time, Babaei is going to prepare the very special birthday party's cake.

Simple cake is a cylinder of some radius and height. The volume of the simple cake is equal to the volume of corresponding cylinder. Babaei has n simple cakes and he is going to make a special cake placing some cylinders on each other.

However, there are some additional culinary restrictions. The cakes are numbered in such a way that the cake number i can be placed only on the table or on some cake number j where j < i. Moreover, in order to impress friends Babaei will put the cake i on top of the cake j only if the volume of the cake i is strictly greater than the volume of the cake j.

Babaei wants to prepare a birthday cake that has a maximum possible total volume. Help him find this value.

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) — the number of simple cakes Babaei has.

Each of the following n lines contains two integers ri and hi (1 ≤ ri, hi ≤ 10 000), giving the radius and height of the i-th cake.

Output

Print the maximum volume of the cake that Babaei can make. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6.

Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct, if <image>.

Examples

Input

2
100 30
40 10


Output

942477.796077000


Input

4
1 1
9 7
1 4
10 7


Output

3983.539484752

Note

In first sample, the optimal way is to choose the cake number 1.

In second sample, the way to get the maximum volume is to use cakes with indices 1, 2 and 4.

Solution (in JAVA):

Solution:
/**
 p * @author prakhar28
 *
 */
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import java.text.*;
import java.math.*;
import java.util.regex.*;


import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

public class Main{
	
	static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;
 
        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
 
        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
 
        public String readLine() throws IOException
        {
            byte[] buf = new byte[200005]; // line length+1
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n' || c==' ') {
                	//buf[cnt++]=(byte)c;
                    break;
                }
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }
 
        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');
 
            if (neg)
                return -ret;
            return ret;
        }
 
        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }
 
        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
 
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
 
            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }
 
            if (neg)
                return -ret;
            return ret;
        }
 
        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
 
        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }
 
        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
	
	static class FastScanner {

	    private final BufferedReader bufferedReader;
	    private StringTokenizer stringTokenizer;

	    public FastScanner() {
	        bufferedReader = new BufferedReader(new InputStreamReader(System.in));
	    }

	    public String next() {
	        while (stringTokenizer == null || !stringTokenizer.hasMoreElements()) {
	            try {
	                stringTokenizer = new StringTokenizer(bufferedReader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException("Can't read next value", e);
	            }
	        }
	        return stringTokenizer.nextToken();
	    }

	    public int nextInt() {
	        return Integer.parseInt(next());
	    }

	    public long nextLong() {
	        return Long.parseLong(next());
	    }

	    public double nextDouble() {
	        return Double.parseDouble(next());
	    }

	    public String nextLine(){
	        String str = "";
	        try {
	            str = bufferedReader.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
	    }
	}
	
	static void closeall() throws IOException{
		printWriter.close();
		sc.close();
		in.close();
	}
	static Scanner sc = new Scanner(System.in);
	static Reader in = new Reader();
	static FastScanner fastScanner = new FastScanner();
	static PrintWriter printWriter = new PrintWriter(new BufferedOutputStream(System.out));
	static BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
	static long INF = (long)(1e18);

	
	int V,E;
	ArrayList<Integer> adj[];
	Main(int v){
		V=v;
		adj=new ArrayList[v];
		for(int i=0;i<v;i++)
			adj[i] = new ArrayList<>();
	}
	void addEdge(int u,int v){
		adj[u].add(v);
		adj[v].add(u);
	}
	
	
	static long power(long a,long k)
	{
		long m = 1000000007;
	    long ans=1;
	    long tmp=a%m;
	    while(k>0)
	    {
	        if(k%2==1)
	        	ans=ans*tmp%m;
	        tmp=tmp*tmp%m;
	        k>>=1;
	    }
	    return ans;
	}
	
	static class Pair implements Comparable<Pair>{
		int a,b;
		Pair(int a,int b){
			this.a=a;
			this.b=b;
		}
		public int compareTo(Pair ob){
			return this.b-ob.b;
		}
		
	}
	static int gcd(int a,int b) {
		if(a<b) {
			int t = a;
			a = b;
			b = t;
		}
		int r = a%b;
		if(r==0)
			return b;
		return gcd(b,r);
	}
	
	static int lower_bound(int[] a,int low,int high,int val) {
		while(low!=high) {
			int mid = (low+high)/2;
			if(a[mid]<val)
				low=mid+1;
			else
				high=mid;
		}
		return low;
	}
	
	static int max(int a,int b) {
		return (int)Math.max(a, b);
	}
	static long max(long a,long b) {
		return (long)Math.max(a, b);
	}
	static long min(long a,long b) {
		return (long)Math.min(a, b);
	}
	static int min(int a,int b) {
		if(a<b)
			return a;
		return b;
	}
	static long m = 1000000007;
	
	public static void main(String args[])throws IOException{
		int n = in.nextInt();
		long v[] = new long[n];
		for(int i=0;i<n;i++) {
			long r = in.nextLong();
			long h = in.nextLong();
			v[i]=r*r*h;
			//printWriter.println(v[i]);
		}
		//printWriter.println("-----");
		Main ob = new Main();
		HashMap<Long,Integer> map = new HashMap<>();
		long g[] = v.clone();
		Arrays.sort(g);
		for(int i=0;i<n;i++) 
			map.put(g[i], i);
		long max = 0;
		for(int i=0;i<n;i++) {
			int idx = map.get(v[i]);
			long max_val = ob.query(0, n-1, 0, idx-1, 0);
			if(idx==0)
				max_val=0;
			//printWriter.println(max_val);
			ob.update(0, n-1, 0, idx, max_val+v[i]);
			max = Math.max(max, max_val+v[i]);
		}
		printWriter.println(max*Math.PI);
		closeall();
	}
	
	long tree[];
	
	Main(){
		tree = new long[400005];
		Arrays.fill(tree, 0);
	}
	
	void update(int low,int high,int pos, int idx,long val) {
		if(low==high) {
			tree[pos]=val;
			return ;
		}
		int mid = (low+high)/2;
		if(low<=idx && idx<=mid)
			update(low,mid,2*pos+1,idx,val);
		else
			update(mid+1,high,2*pos+2,idx,val);
		tree[pos]=Math.max(tree[2*pos+1], tree[2*pos+2]);
		
	}
	
	long query(int low,int high,int qlow,int qhigh,int pos) {
		if(qhigh<low || qlow>high)
			return Long.MIN_VALUE;
		if(qlow<=low && qhigh>=high)
			return tree[pos];
		int mid = (low+high)/2;
		long p = query(low,mid,qlow,qhigh,2*pos+1);
		long q = query(mid+1,high,qlow,qhigh,2*pos+2);
		return (long)Math.max(p, q);
	}
}