#K44807. Find the Largest Integer Y
Find the Largest Integer Y
Find the Largest Integer Y
Given two positive integers A and B, find the maximum integer Y such that:
$$Y^2 \le A \times B$$
This problem requires you to compute the largest integer Y whose square does not exceed the product of A and B. You are expected to implement an efficient algorithm that works even for very large inputs.
Note: The inputs are provided via standard input and the answer should be printed to standard output.
inputFormat
The input consists of a single line containing two positive integers A and B separated by a space.
For example:
10 5
outputFormat
Output a single integer, the largest integer Y such that Y2 \le A \times B.
For example:
7## sample
10 5
7