#B4243. Calculate the Perimeter of a Rectangle

    ID: 11900 Type: Default 1000ms 256MiB

Calculate the Perimeter of a Rectangle

Calculate the Perimeter of a Rectangle

You are given an integer a representing the length of a rectangle and its area S. The rectangle is known to have integer side lengths. Your task is to compute the perimeter L of the rectangle.

Since the width b must be an integer, it can be computed as \( b = \frac{S}{a} \). The perimeter can then be calculated using the formula:

\( L = 2\left(a+\frac{S}{a}\right) \)

It is guaranteed that S is divisible by a.

inputFormat

The first and only line of input contains two space-separated integers: a (the length) and S (the area) of the rectangle.

outputFormat

Output a single integer representing the perimeter L of the rectangle.

sample

4 20
18