import java.util.*;
import java.io.*;

public class robo {
    public static void main(String[] Args) {
        Scanner sc = new Scanner(System.in);
        
        // Read in the number of boosters
        int n = sc.nextInt();
        
        // Allocate room for the booster
        Booster[] boosts = new Booster[n];
        
        // Initialize distance stuff
        long originalDist2 = 0;
        long currentVelocity = 0;
        
        // Read in and compute the original boosters' effectiveness
        for (int i = 0; i < n; i++) {
            // Read in the description of the booster
            long accel = sc.nextLong();
            long time = sc.nextLong();
            
            // Store the information for later
            boosts[i] = new Booster(time, accel);
            
            // Update the distance
            originalDist2 += 2 * currentVelocity * time;
            currentVelocity += accel * time;
            originalDist2 += accel * time * time;
        }
        
        long bestDist2 = 0;
        currentVelocity = 0;
        // Compute Best Distance Greedily
        Arrays.sort(boosts);
        for (int i = 0; i < n; i++){
            long time = boosts[i].time;
            long accel = boosts[i].accel;
            bestDist2 += 2 * currentVelocity * time;
            currentVelocity += accel * time;
            bestDist2 += accel * time * time;
        }
        
        // Compute the answer
        long difference2 = bestDist2;
        difference2 -= originalDist2;
        
        // Print the "formatted" answer
        System.out.println((difference2 / 2) + "." + (5 * (difference2 % 2))); 
        // System.out.println((bestDist2 / 2) + "." + (5 * (bestDist2 % 2))); 
        // System.out.println((originalDist2 / 2) + "." + (5 * (originalDist2 % 2))); 
    }
    
    public static class Booster implements Comparable<Booster>{
        long time;
        long accel;
        
        Booster(long tt, long aa){
            time = tt;
            accel = aa;
        }
        
        public int compareTo(Booster o){
            return Long.compare(o.accel, accel);
            // Double.compare(o.accel, accel);
        }
    }
}