Vous êtes sur la page 1sur 4

Renovation Costs

Coding club is making their study hall have more windows. Each Mentor said some certain
amount of area in wall that should be converted to window. Contracter only convert area from
wall to window in squares and each square, irrespective of size, costs rupees. Now everyone is
interested in knowing if the exact area by mentioned by mentor can even be carved and if it can
be then what is the minimum cost.

Output Format

For each mentor Output following if the mentioned area can be converted to wall (without
quotes)

"YES"

else print "NO"

Sample Input 0
35
256
4
1
4
12
29

Sample Output 0
NO
YES 5
YES 15
YES 10

Explanation 0

There is no way to make a windows of area 1 sq. ft. when these squares are available

For a window of 4 sq. ft. a square with side 2 is enough thus cost = 5

For a window of 12 sq. ft. 3 squares with side 2 are enough thus cost = 15

For a window of 29 sq. ft. 1 square with side 5 and 1 square with side 2. thus cost = 10

Changed Subarrays
Factor of One

Vous aimerez peut-être aussi