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:
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main
{	
	/********************************************** a list of common variables **********************************************/
	private MyScanner scan = new MyScanner();
	private PrintWriter out = new PrintWriter(System.out);
	private final double PI = Math.acos(-1.0);
	private final int SIZEN = (int)(1e5);
	private final int MOD = (int)(1e9 + 7);
	private final int[] DX = {0, 1, 0, -1}, DY = {-1, 0, 1, 0};
	private ArrayList<Integer>[] edge;
	private Node[] t;
	private long maxV;
	
	public void build(int k, int left, int right)
	{
		t[k].left = left;
		t[k].right = right;
		if(left != right)
		{
			int mid = (left + right) >> 1;
			build(k << 1, left, mid);
			build(2 * k + 1, mid + 1, right);
		}
	}
	
	public void update(int k, int pos, long vv)
	{
		int left = t[k].left, right = t[k].right;
		if(left == right)
		{
			t[k].dp = Math.max(t[k].dp, vv);
			return;
		}
		int mid = (left + right) >> 1;
		if(pos <= mid) update(k << 1, pos, vv);
		else update(2 * k + 1, pos, vv);
		t[k].dp = Math.max(t[k].dp, Math.max(t[2 * k].dp, t[2 * k + 1].dp));
	}
	
	public void query(int k, int left, int right)
	{
		if(left <= t[k].left && right >= t[k].right)
		{
			maxV = Math.max(maxV, t[k].dp);
			return;
		}
		int mid = (t[k].left + t[k].right) >> 1;
		if(left <= mid) query(k << 1, left, right);
		if(right > mid) query(2 * k + 1, left, right);
	}
	
	public void foo()
	{
		int n = scan.nextInt();
		Point[] p = new Point[n];
		for(int i = 0;i < n;++i)
		{
			int r = scan.nextInt();
			int h = scan.nextInt();
			p[i] = new Point(i + 1, (long)r * r * h);
		}
		Arrays.sort(p, new Comparator<Point>()
		{
			public int compare(Point p1, Point p2)
			{
				if(p1.v != p2.v) return p1.v < p2.v ? -1 : 1;
				else return p2.index - p1.index;
			}
		});
		t = new Node[n << 2];
		for(int i = 0;i < t.length;++i)
		{
			t[i] = new Node(0,0,0);
		}
		build(1, 1, n);
		long ans = 0;
		for(int i = 0;i < n;++i)
		{
			maxV = 0;
			query(1, 1, p[i].index);
			update(1, p[i].index, maxV + p[i].v);
			ans = Math.max(ans, maxV + p[i].v);
		}
		out.println(PI * ans);
	}

	public static void main(String[] args)
	{
		Main m = new Main();
		m.foo();
		m.out.close();
	}
	
	class Point
	{
		private int index;
		private long v;
		public Point(int aIndex, long aV)
		{
			index = aIndex;
			v = aV;
		}
	}
	
	class Node
	{
		private int left, right;
		private long dp;
		public Node(int aLeft, int aRight, long aDp)
		{
			left = aLeft;
			right = aRight;
			dp = aDp;
		}
	}


	/********************************************** a list of common algorithms **********************************************/
	/**
	 * 1---Get greatest common divisor
	 * @param a :	first number
	 * @param b :	second number
	 * @return		greatest common divisor
	 */
	public long gcd(long a, long b)
	{
		return 0 == b ? a : gcd(b, a % b);
	}
	
	/**
	 * 2---Get the distance from a point to a line
	 * @param x1	the x coordinate of one endpoint of the line
	 * @param y1	the y coordinate of one endpoint of the line
	 * @param x2	the x coordinate of the other endpoint of the line
	 * @param y2	the y coordinate of the other endpoint of the line
	 * @param x		the x coordinate of the point 
	 * @param y		the x coordinate of the point
	 * @return		the distance from a point to a line
	 */
	public double getDist(long x1, long y1, long x2, long y2, long x, long y)
	{
		long a = y2 - y1;
		long b = x1 - x2;
		long c = y1 * (x2 - x1) - x1 * (y2 - y1);
		return Math.abs(a * x + b * y + c) / Math.sqrt(a * a + b * b);
	}
	
	/**
	 * 3---Get the distance from one point to a segment (not a line)
	 * @param x1	the x coordinate of one endpoint of the segment
	 * @param y1	the y coordinate of one endpoint of the segment
	 * @param x2	the x coordinate of the other endpoint of the segment
	 * @param y2	the y coordinate of the other endpoint of the segment
	 * @param x		the x coordinate of the point
	 * @param y		the y coordinate of the point
	 * @return		the distance from one point to a segment (not a line)
	 */
	public double ptToSeg(long x1, long y1, long x2, long y2, long x, long y)
	{
		double cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1);
		if(cross <= 0)
		{
			return (x - x1) * (x - x1) + (y - y1) * (y - y1);
		}
		double d = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
		if(cross >= d) 
		{
			return (x - x2) * (x - x2) + (y - y2) * (y - y2);
		}
		double r = cross / d;
		double px = x1 + (x2 - x1) * r;
		double py = y1 + (y2 - y1) * r;
		return (x - px) * (x - px) + (y - py) * (y - py);
	}
	
	/**
	 * 4---KMP match, i.e. kmpMatch("abcd", "bcd") = 1, kmpMatch("abcd", "bfcd") = -1.
	 * @param s:	String to match.
	 * @param t:	String to be matched.
	 * @return		if can match, first index; otherwise -1.
	 */
	public int[] kmpMatch(char[] s, char[] t)
	{
		int n = s.length;
		int m = t.length;
		int[] next = new int[m + 1];
		next[0] = -1;
		int j = -1;
		for(int i = 1;i < m;++i)
		{
			while(j >= 0 && t[i] != t[j + 1])
			{
				j = next[j];
			}
			if(t[i] == t[j + 1])
			{
				++j;
			}
			next[i] = j;
		}
		int[] left = new int[n + 1];
		j = -1;
		for(int i = 0;i < n;++i)
		{
			while(j >= 0 && s[i] != t[j + 1])
			{
				j = next[j];
			}
			if(s[i] == t[j + 1])
			{
				++j;
			}
			if(j == m - 1)
			{
				left[i + 1] = i - m + 2;
				j = next[j];
			}
		}
		for(int i = 1;i <= n;++i)
		{
			if(0 == left[i])
			{
				left[i] = left[i - 1];
			}
		}
		return left;
	}
	
	class MyScanner
	{
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;
	    BufferedInputStream bis = new BufferedInputStream(System.in);

	    public int read() 
	    {
	        if (-1 == numChars)
	        {
	        	throw new InputMismatchException();
	        }
	        if (curChar >= numChars)
	        {
	            curChar = 0;
	            try 
	            {
	                numChars = bis.read(buf);
	            }
	            catch (IOException e)
	            {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	            {
	            	return -1;
	            }
	        }
	        return buf[curChar++];
	    }

	    public int nextInt() 
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-') 
	        {
	            sgn = -1;
	            c = read();
	        }
	        int res = 0;
	        do 
	        {
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c - '0';
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }
	    
	    public long nextLong() 
	    {
	    	int c = read();
	    	while (isSpaceChar(c))
	    	{
	    		c = read();
	    	}
	    	int sgn = 1;
	    	if (c == '-') 
	    	{
	    		sgn = -1;
	    		c = read();
	    	}
	    	long res = 0;
	    	do 
	    	{
	    		if (c < '0' || c > '9')
	    		{
	    			throw new InputMismatchException();
	    		}
	    		res *= 10;
	    		res += c - '0';
	    		c = read();
	    	} while (!isSpaceChar(c));
	    	return res * sgn;
	    }
	    
	    public double nextDouble() 
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        double res = 0;
	        while (!isSpaceChar(c) && c != '.') 
	        {
	            if (c == 'e' || c == 'E')
	            {
	            	return res * Math.pow(10, nextInt());
	            }
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c & 15;
	            c = read();
	        }
	        if (c == '.') 
	        {
	            c = read();
	            double m = 1;
	            while (!isSpaceChar(c)) 
	            {
	                if (c == 'e' || c == 'E')
	                {
	                	return res * Math.pow(10, nextInt());
	                }
	                if (c < '0' || c > '9')
	                {
	                	throw new InputMismatchException();
	                }
	                m /= 10;
	                res += (c & 15) * m;
	                c = read();
	            }
	        }
	        return res * sgn;
	    }
	    
	    public String next()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        StringBuilder res = new StringBuilder();
	        do 
	        {
	            res.appendCodePoint(c);
	            c = read();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    private boolean isSpaceChar(int c) 
	    {
	        return ' ' == c || '\n' == c || '\r' == c || '\t' == c || -1 == c;
	    }
	}
}