Math, asked by aanya7137, 1 year ago

A big company decided to launch a new series of rectangular displays, and decided that the display must have exactly n pixels. Your task is to determine the size of the rectangular display the number of lines (rows) of pixels a and the number of columns of pixels b, so that: there are exactly n pixels on the display; the number of rows does not exceed the number of columns, it means ab; the difference b-a is as small as possible.

Answers

Answered by vivek1000
0

Start from the square root of n;

a = root(n),

while(a > 0)

if(n (mod a) == 0)

break

a--

Similar questions