<commit_before>package codeforces.neerc.south2013;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.Locale;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class F {
    private BufferedReader br;
    private PrintWriter out;
    private StringTokenizer st;

    public F() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
    }

    public static void main(String[] args) throws IOException {
        new F().solve();
    }

    private void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        int[] time = new int[n];
        double[] p = new double[n];

        for (int i = 0; i < n; i++) {
            time[i] = nextInt();
            p[i] = nextDouble();
        }

        double expectedTotalTime = 0D;
        int[] timeFinished = calculateTimeFinished(m,  time);
        int expectedTime = 0;
        double pp = 1D;
        for (int i = 0; i < n; i++) {
            expectedTime = Math.max(expectedTime, timeFinished[i]);
            double probability = pp * (1 - p[i]);
            pp *= p[i];
            expectedTotalTime += expectedTime * probability;
        }
        expectedTotalTime += pp * expectedTime;

        out.printf(Locale.US, "%.6f", expectedTotalTime);
        out.close();
    }

    private int[] calculateTimeFinished(int m,  int[] time) {<commit_msg>code clean up in F problem : silly renaming<commit_after>package codeforces.neerc.south2013;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.Locale;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class F {
    private BufferedReader br;
    private PrintWriter out;
    private StringTokenizer st;

    public F() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
    }

    public static void main(String[] args) throws IOException {
        new F().solve();
    }

    private void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        int[] time = new int[n];
        double[] probability = new double[n];

        for (int i = 0; i < n; i++) {
            time[i] = nextInt();
            probability[i] = nextDouble();
        }

        double expectedTotalTime = 0D;
        int[] timeFinished = calculateTimeFinished(m,  time);
        int expectedTime = 0;
        double p = 1D;
        for (int i = 0; i < n; i++) {
            expectedTime = Math.max(expectedTime, timeFinished[i]);
            double currentProbability = p * (1 - probability[i]);
            expectedTotalTime += expectedTime * currentProbability;
            p *= probability[i];
        }
        expectedTotalTime += p * expectedTime;

        out.printf(Locale.US, "%.6f", expectedTotalTime);
        out.close();
    }

    private int[] calculateTimeFinished(int m,  int[] time) {
{'fraction_non_alphanumeric': 0.1152638190954774, 'fraction_numerical': 0.006909547738693468, 'mean_word_length': 2.458197611292074, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1351280', 'n_tokens_mistral': 936, 'n_tokens_neox': 906, 'n_words': 259}