Problem:
Bange Hills Tower

A project is underway to build a new viewing tower in Bange town called “Bange Hills Tower” whose selling point will be the gorgeous view of the entire main keep of Wakamatsu Castle from top to bottom. Therefore, the view line from the top of the tower must reach the bottom of the keep without being hindered by any of the buildings in the town.

Write a program to calculate the minimum tower height required to view the keep in its entirety based on the following information: the planned location of the tower and the heights and locations of existing buildings. Assume all the buildings, including the keep, are vertical lines without horizontal stretch. “view of the entire keep” means that the view line from the tower top can cover the keep from the bottom to the top without intersecting (contacts at the top are exempted) any of the other vertical lines (i.e., buildings).

Input

The input is given in the following format.

N t
x_1 h_1
x_2 h_2
:
x_N h_N

The first line provides the number of existing buildings N (1≤N≤1000) and the planned location of the tower t (2≤t≤105) in integers. Each of the subsequent N lines provides the information of the i-th building: location x_i (1 ≤ x_i < t) and height from the ground h_i (1 ≤ h_i ≤ 100). All position information is one-dimensional along the ground line whose origin coincides with the Keep location. No more than one building is located in the same location (i.e. if i ≠ j, then x_i ≠ x_j).

Output

Output the required height as a real number. No limits on the number of decimal places as long as the error does not exceed ± 10-3.

Sample Input 1

3 10
6 4
4 2
3 2

Sample Output 1

6.666667

Solution in JAVA (judge verdict: Accepted)

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, t;
        double a = 0.0, x, h;

        n = sc.nextInt();
        t = sc.nextInt();
        for(int i = 0; i < n; i++) {
            x = sc.nextInt();
            h = sc.nextInt();
            a = Math.max(a, h / x);
        }

        System.out.printf("%.6f", a * t);
    }
}