아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Work

면접 대비

시간 제한1초메모리 제한1024 MB

요약
K, P, X가 주어질 때 화가 수 M을 정해 M·X + P·(K/M)을 최소로 만들고, 그 비용을 소수 셋째 자리까지 출력한다.
난이도

보통10점 중 4점

유형
수학, 완전 탐색
정답자
아직 제출이 없습니다

문제

You own a company that hires painters to paint houses. You can hire as many painters as you want, but for every painter you hire, you have to pay X dollars (independent of how long the painter works on the house). In addition, you have to pay a penalty of D · P dollars overall if it takes D days to finish painting the house. This penalty does not depend on the number of painters you hire; furthermore, even if the time taken is not a whole number of days, you are only penalized for the exact time taken. All painters paint at the same rate. One painter can finish painting the house in K days. The painters cooperate so well that it will only take K/M days for M painters to finish painting the house. What is the minimum amount of money you will have to pay, including what you pay to the painters and the cost penalty, to get a house painted?

입력

The first line will contain a single integer n that indicates the number of data sets that follow. Each data set consists of a single line containing three space-separated integers K, P, and X (1 ≤ K, P, X ≤ 10,000).

출력

For each data set print, on a single line, the minimum cost to have the house painted, rounded and displayed to exactly three decimal places.

예제1

  1. 예제 1

    입력
    2
    31 41 59
    3 4 5
    
    예상 출력
    549.200
    16.000